Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 150 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,150 @@
.venv/
**/__pycache__/**
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
Pipfile.lock

# PEP 582
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~
.cursor/

# OS
.DS_Store
Thumbs.db

# Power system specific files (temporary outputs)
*.log
*.out
*.tmp
*.nc
*.h5

# UV package manager
.uv/
uv.lock

# MCP/Gradio
flagged/
*.gradio/
24 changes: 24 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Include documentation
include README.md
include LICENSE
include config.json

# Include all data files in subdirectories
recursive-include ANDES *.json *.dyd
recursive-include Egret *.m *.json
recursive-include OpenDSS *.dss *.csv
recursive-include pandapower *.json
recursive-include PowerWorld *.pwb *.pwd
recursive-include PSLF *.sav *.otg *.cntl *.dycr *.dyd
recursive-include PSSE *.dyr *.sav *.con *.mon *.sub
recursive-include PSSE35 *.dyr *.sav *.con *.mon *.sub
recursive-include PyLTSpice *.txt
recursive-include PyPSA *.nc *.txt

# Include all README files
recursive-include * README.md

# Exclude test files and cache
recursive-exclude tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Binary file removed PyPSA/test_case.nc
Binary file not shown.
85 changes: 85 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
"""
PowerMCP - Power System Analysis MCP Server Collection

An open-source collection of MCP (Model Context Protocol) servers
for power system simulation and analysis software.

Supported tools:
- pandapower: Power system modeling and analysis
- PyPSA: Power system optimization
- ANDES: Power system dynamics simulation
- OpenDSS: Distribution system analysis
- And more...
"""

__version__ = "0.1.0"

# Import availability flags and key functions from submodules
from pandapower_tools import (
PANDAPOWER_AVAILABLE,
create_empty_network as pandapower_create_empty_network,
create_test_network as pandapower_create_test_network,
load_network as pandapower_load_network,
run_power_flow as pandapower_run_power_flow,
run_dc_power_flow as pandapower_run_dc_power_flow,
get_network_info as pandapower_get_network_info,
add_bus as pandapower_add_bus,
add_line as pandapower_add_line,
add_load as pandapower_add_load,
add_generator as pandapower_add_generator,
add_ext_grid as pandapower_add_ext_grid,
run_contingency_analysis as pandapower_run_contingency_analysis,
get_available_std_types as pandapower_get_available_std_types,
)

from pypsa_tools import (
PYPSA_AVAILABLE,
create_network as pypsa_create_network,
get_network_info as pypsa_get_network_info,
add_bus as pypsa_add_bus,
add_generator as pypsa_add_generator,
add_load as pypsa_add_load,
add_line as pypsa_add_line,
run_power_flow as pypsa_run_power_flow,
run_optimal_power_flow as pypsa_run_optimal_power_flow,
load_network as pypsa_load_network,
save_network as pypsa_save_network,
)

# Convenience imports for submodules
from . import pandapower_tools
from . import pypsa_tools

__all__ = [
'__version__',
# Pandapower
'PANDAPOWER_AVAILABLE',
'pandapower_create_empty_network',
'pandapower_create_test_network',
'pandapower_load_network',
'pandapower_run_power_flow',
'pandapower_run_dc_power_flow',
'pandapower_get_network_info',
'pandapower_add_bus',
'pandapower_add_line',
'pandapower_add_load',
'pandapower_add_generator',
'pandapower_add_ext_grid',
'pandapower_run_contingency_analysis',
'pandapower_get_available_std_types',
# PyPSA
'PYPSA_AVAILABLE',
'pypsa_create_network',
'pypsa_get_network_info',
'pypsa_add_bus',
'pypsa_add_generator',
'pypsa_add_load',
'pypsa_add_line',
'pypsa_run_power_flow',
'pypsa_run_optimal_power_flow',
'pypsa_load_network',
'pypsa_save_network',
# Submodules
'pandapower_tools',
'pypsa_tools',
]
File renamed without changes.
37 changes: 37 additions & 0 deletions pandapower_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""PowerMCP Pandapower Tools - Power system analysis using pandapower."""

from .tools import (
PANDAPOWER_AVAILABLE,
create_empty_network,
create_test_network,
get_available_networks,
load_network,
run_power_flow,
run_dc_power_flow,
get_network_info,
add_bus,
add_line,
add_load,
add_generator,
add_ext_grid,
run_contingency_analysis,
get_available_std_types,
)

__all__ = [
'PANDAPOWER_AVAILABLE',
'create_empty_network',
'create_test_network',
'get_available_networks',
'load_network',
'run_power_flow',
'run_dc_power_flow',
'get_network_info',
'add_bus',
'add_line',
'add_load',
'add_generator',
'add_ext_grid',
'run_contingency_analysis',
'get_available_std_types',
]
File renamed without changes.
File renamed without changes.
Loading