// pypi 패키지
epyt
EPyT: An EPANET-Python Toolkit for Smart Water Network Simulations. The EPyT is inspired by the EPANET-Matlab Toolkit.
버전
36
메인테이너
1
최초 publish
2022-05-27
publisher
Marios S. Kyriakou
tarball
4,125,575 B
AUTO-PUBLISHED·1개 버전 인덱싱됨·최근 publish: 2026-06-04
// exfil path
what is read → where it shipssteals
- ● PyPI token
- ○ fs recursive read
sends to
- ⌖ 2.3.5.1
// offending code· @2.3.5.1· 4 files flagged
llm: malicious · 0.95→ 크리덴셜 읽기 (reads-pypirc) + 외부 전송지 http-to-public-ip 조합 — 전형적인 유출 패턴.
- @2.3.5.1··AUTO-PUBLISHED·publisher: Marios S. Kyriakouheuristic 53/100static flags 5llm malicious (0.95) via fast-trackpypi-sdist-setup-pynew-publisher:0dtypo-match:pytz:d2mature-packagehas-source-reporeads-pypircfs-recursive-readhttp-to-public-ipchild-process-spawnpy-sys-platform-branch
→ 크리덴셜 읽기 (reads-pypirc) + 외부 전송지 http-to-public-ip 조합 — 전형적인 유출 패턴.
// offending code· 4 files flaggedpatterns: 5
--- epyt-2.3.5.1/setup.py (excerpt) --- from setuptools import setup import os # python setup.py bdist_wheel # python setup.py sdist # twine upload dist/* --config-file .pypirc def read_version_from_init(file_path="epyt/__init__.py"): version_line = None with open(file_path, "r", encoding="utf-8") as f: for line in f: if line.startswith("__version__"): version_line = line break if version_line: version_str = version_line.split("=")[1].strip().strip('"').strip("'") return version_str else: raise RuntimeError("Unable to find version string.") __version__ = read_version_from_init() module_name = 'epyt' data = list() packages = list() pack_path = os.path.join(os.getcwd(), module_name) for root, dirs, files in os.walk(pack_path): p = '/' if root == pack_path: packages = dirs p = '' for file in files: data.append(f"{root[len(pack_path) + 1:]}{p}{file}") packages = [f"{module_name}.{x}" for x in packages] packages.append(module_name) with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name=module_name, version=f"{__version__}", author="Marios S. Kyriakou", author_email="kiriakou.marios@ucy.ac.cy", description='EPyT: An EPANET-Python Toolkit for Smart Water Network Simulations. The EPyT is inspired by the ' 'EPANET-Matlab Toolkit.', long_description=long_descript --- epyt-2.3.5.1/epyt/__init__.py (excerpt) --- # -*- coding: utf-8 -*- __author__ = """Marios S. Kyriakou""" __email__ = "kiriakou.marios@ucy.ac.cy" __version__ = "2.3.5.1" __msxversion__ = "200000" __lastupdate__ = "04/06/2026" __copyright__ = """Copyright 2022, KIOS Research and Innovation Center of Excellence (KIOS CoE), University of Cyprus (www.kios.org.cy).""" __license__ = "EUPL License, Version 1.2" from importlib.resources import files # Python 3.9+ epyt_root = str(files("epyt")) from epyt.epanet import epanet --- epyt-2.3.5.1/epyt/epanet.py (excerpt) --- # -*- coding: utf-8 -*- """ EPANET-Python Toolkit (EPyT): A Python toolkit for EPANET libraries How to run: from epyt import epanet d = epanet('Net1.inp') EPANET is software that models water distribution piping systems developed by the US EPA and provided under a public domain licence. This python toolkit serves as an interface between Python and EPANET, to assist researchers and the industry when solving problems related with water distribution systems. EPANET was developed by the Water Supply and Water Resources Division of the U.S. Environmental Protection Agency's National Risk Management Research Laboratory. EPANET is under the Public Domain. The latest EPANET files can downloaded at: https://github.com/OpenWaterAnalytics/EPANET Inspired by: EPANET-MATLAB Toolkit D.G. Eliades, M. Kyriakou, S. Vrachimis and M.M. Polycarpou, "EPANET-MATLAB Toolkit: An Open-Source Software for Interfacing EPANET with MATLAB", in Proc. 14th International Conference on Computing and Control for the Water Industry (CCWI), The Netherlands, Nov 2016, p.8. (doi:10.5281/zenodo.831493) Other python packages related to the EPANET engine: wntr Klise, K.A., Murray, R., Haxton, T. (2018). An overview of the Water Network Tool for Resilience (WNTR), In Proceedings of the 1st International WDSA/CCWI Joint Conference, Kingston, Ontario, Canada, July 23-25, 075, 8p. epanet-pyt --- epyt-2.3.5.1/epyt/src/epanetapi.py (excerpt) --- import os import sys import warnings from functools import partial from pathlib import Path from epyt import epyt_root from .epanet_cffi_compat import cdll, byref, create_string_buffer, c_uint64, c_void_p, c_int, c_double, c_float, c_long, \ c_char_p, funcptr_null, EN_Project_p def _default_lib_path(): base = Path(epyt_root) / "libraries" if sys.platform.startswith("win"): return base / "win" / "epanet2.dll" elif sys.platform == "darwin": return base / "mac" / "libepanet2.dylib" else: return base / "glnx" / "libepanet2.so" def _load_library(path_str: str): lib = _LIB_CACHE.get(path_str) if lib is None: # Support compat layers that expose either .LoadLibrary(...) or are callable (dlopen) loader = getattr(cdll, "LoadLibrary", None) lib = loader(path_str) if loader else cdll(path_str) _LIB_CACHE[path_str] = lib return lib _DEFAULT_LIB_PATH = str(_default_lib_path()) _LIB_CACHE = {} class epanetapi: """ EPANET Toolkit functions - API """ __slots__ = ("_lib", "errcode", "inpfile", "rptfile", "binfile", "_ph", "LibEPANET", "LibEPANETpath", "solve", "_t_long", "_openH", "_runH", "_nextH", "_close", "_closeH", "_initH", "_openQ", "_runQ", "_nextQ", "_closeQ", "_initQ", "_t_int", "_t_double", "_t_float", "_t_char_p", "_t_void_p") EN_MAXID = 32 # Maximum
