pypsa
Python for Power Systems Analysis
Decision gist · record as of 2026-08-14
Yes. PyPSA is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and installs with low friction. It is well-suited for power system research, planning, and operational analysis. Install it if you need to model or optimize energy systems at any scale from local microgrids to continental networks.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- Optimization requires an external solver; HiGHS is installed by default, but Gurobi, FICO Xpress, GLPK, or CBC can be used.
- Low install friction with a pure-wheel distribution.
License · maintenance · safety
permissive license (permissive) — MIT License permits unrestricted commercial and private use, modification, and distribution with minimal restrictions. You may use PyPSA in proprietary projects without licensing concerns.
last release 2026-06-27 (48 days) · last repo commit 2026-08-14 · 2,104 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 106,863 downloads/mo, #12,635 on PyPI
Alternatives
Verify before relying
import pypsa
n = pypsa.Network()
n.add("Bus", "mybus")
n.add("Load", "myload", bus="mybus", p_set=100)
n.add("Generator", "mygen", bus="mybus", p_nom=100, marginal_cost=20)
n.optimize()
n.plot()- Whether the default HiGHS solver is sufficient for your problem scale or if commercial solvers are needed for performance
- Specific solver compatibility and licensing requirements for your use case
What it is and what it does
PyPSA is an open-source framework for modeling and optimizing modern power and energy systems. It handles conventional generators with unit commitment, variable renewable generation (wind and solar), hydro-electricity, inter-temporal storage, and coupling between energy sectors (electricity, heat, hydrogen). The framework supports multiple analysis modes: economic dispatch for short-term market simulation, linear optimal power flow for least-cost dispatch respecting network constraints, capacity expansion planning for long-term infrastructure investment decisions, and stochastic optimization for uncertainty. It is built on pandas for data storage, scipy and numpy for linear algebra, linopy for optimization problem formulation, and networkx for network calculations.
PyPSA is designed for researchers, planners, and utilities who need transparent, fast analysis of large networks over long time series. It includes visualization via matplotlib, seaborn, and plotly, and supports both AC and DC power flow analysis with optional loss approximations. The framework scales well with problem size and provides extensive documentation with tutorials and examples.
Use it for
- Model and optimize dispatch of a regional electricity grid with mixed renewable and conventional generation over a year of hourly data
- Plan long-term capacity expansion for generation, storage, and transmission infrastructure to meet decarbonization targets
- Analyze security-constrained optimal power flow to ensure system reliability under line outage contingencies
- Simulate integrated energy systems coupling electricity, heating, and hydrogen production with sector-specific technologies
- Explore near-optimal system configurations using modelling-to-generate-alternatives to understand feasible design trade-offs
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
PyPSA is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and installs with low friction. It is well-suited for power system research, planning, and operational analysis. Install it if you need to model or optimize energy systems at any scale from local microgrids to continental networks.
Install
pypsa on PyPI
Before you install
Low install friction with a pure-wheel distribution. Active maintenance with a release 48 days ago and last commit on 2026-08-14. Supports Python 3.11 through 3.14. Depends on 18 runtime packages including scipy, pandas, networkx, and linopy for optimization.
Requires Python 3.11 or later. Optimization requires an external solver; HiGHS is installed by default, but Gurobi, FICO Xpress, GLPK, or CBC can be used.
License in practice
MIT License permits unrestricted commercial and private use, modification, and distribution with minimal restrictions. You may use PyPSA in proprietary projects without licensing concerns.
Quickstart
import pypsa
n = pypsa.Network()
n.add("Bus", "mybus")
n.add("Load", "myload", bus="mybus", p_set=100)
n.add("Generator", "mygen", bus="mybus", p_nom=100, marginal_cost=20)
n.optimize()
n.plot()
Verify before relying
- Whether the default HiGHS solver is sufficient for your problem scale or if commercial solvers are needed for performance
- Specific solver compatibility and licensing requirements for your use case
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 18 packagesnumpyscipypandasxarraynetcdf4linopymatplotlibplotlypydeckseaborngeopandasshapelynetworkxdeprecationvalidatorshighspylevenshteinplatformdirs |
| Maintenance | Actively maintained 48 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 106,863 / month, #12,635 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed |
Evidence: pypsa-1.2.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “optimal power flow”
- pypsaPyPSA is a Python framework for optimizing and simulating power and…
- power-grid-modelPower Grid Model is a Python/C++ library for steady-state…
- pandapowerpandapower automates power system modeling, analysis, and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also pandapower · power-grid-model · opower · pyomo · forecast-solar · NREL-PySAM · joulescope · amplpy · openbb-us-eia