--- id: pypsa version: "1.2.4" license: MIT License Copyright (c) 2015-2026 PyPSA contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) license_treatment: permissive maintenance: active --- # pypsa — Python for Power Systems Analysis License: permissive · Maintenance: active · Downloads: 106.9K/mo ## 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 above — verify before relying. PyPSA is a Python framework for optimizing and simulating power and energy systems, supporting economic dispatch, optimal power flow, capacity expansion planning, and sector-coupling with multiple energy carriers. 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 pip install pypsa uv add pypsa poetry add pypsa ## Installing pypsa 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. 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() 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. 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: MIT License Copyright (c) 2015-2026 PyPSA contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 106.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags power system optimization, energy system modeling, optimal power flow, capacity expansion planning, economic dispatch, power flow analysis, energy sector coupling, power-systems, energy-optimization, sector-coupling [View on SkillFed](https://skillfed.io/packages/pypsa) · [View on PyPI](https://pypi.org/project/pypsa/)