{"id":15032529,"url":"https://github.com/pypsa/pypsa","last_synced_at":"2026-05-25T23:05:08.345Z","repository":{"id":3421415,"uuid":"49414256","full_name":"PyPSA/PyPSA","owner":"PyPSA","description":"PyPSA: Python for Power System Analysis","archived":false,"fork":false,"pushed_at":"2025-05-12T11:05:45.000Z","size":49806,"stargazers_count":1506,"open_issues_count":110,"forks_count":518,"subscribers_count":71,"default_branch":"master","last_synced_at":"2025-05-12T22:43:54.564Z","etag":null,"topics":["capacity-expansion-planning","clean-energy","climate-change","electrical-engineering","electricity","energy","energy-system","energy-systems","linopy","loadflow","optimal-power-flow","optimisation","power-flow","power-systems","power-systems-analysis","powerflow","pypsa","python","renewable-energy","renewables"],"latest_commit_sha":null,"homepage":"https://pypsa.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PyPSA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-01-11T09:04:18.000Z","updated_at":"2025-05-11T07:58:07.000Z","dependencies_parsed_at":"2023-09-21T17:37:26.976Z","dependency_job_id":"4777aa38-1fd8-4f7e-b3bb-18f2b8be1c81","html_url":"https://github.com/PyPSA/PyPSA","commit_stats":{"total_commits":2176,"total_committers":92,"mean_commits":"23.652173913043477","dds":0.8065257352941176,"last_synced_commit":"8dd330ebda32edc6ede36f0f7a5b743307296533"},"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2FPyPSA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2FPyPSA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2FPyPSA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2FPyPSA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyPSA","download_url":"https://codeload.github.com/PyPSA/PyPSA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990468,"owners_count":21995774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capacity-expansion-planning","clean-energy","climate-change","electrical-engineering","electricity","energy","energy-system","energy-systems","linopy","loadflow","optimal-power-flow","optimisation","power-flow","power-systems","power-systems-analysis","powerflow","pypsa","python","renewable-energy","renewables"],"created_at":"2024-09-24T20:18:39.105Z","updated_at":"2026-05-25T23:05:08.326Z","avatar_url":"https://github.com/PyPSA.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: PyPSA Contributors\n\nSPDX-License-Identifier: MIT\n--\u003e\n\n\u003cpicture align=\"center\"\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/PyPSA/PyPSA/refs/heads/master/docs/assets/logo/logo-primary-dark.svg\"\u003e\n  \u003cimg alt=\"PyPSA Banner\" src=\"https://raw.githubusercontent.com/PyPSA/PyPSA/refs/heads/master/docs/assets/logo/logo-primary-light.svg\"\u003e\n\u003c/picture\u003e\n\n# PyPSA - Python for Power System Analysis\n\n\n[![PyPI version](https://img.shields.io/pypi/v/pypsa.svg)](https://pypi.python.org/pypi/pypsa)\n[![Conda version](https://img.shields.io/conda/vn/conda-forge/pypsa.svg)](https://anaconda.org/conda-forge/pypsa)\n![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FPyPSA%2FPyPSA%2Fmaster%2Fpyproject.toml)\n[![Tests](https://github.com/PyPSA/PyPSA/actions/workflows/test.yml/badge.svg)](https://github.com/PyPSA/PyPSA/actions/workflows/test.yml)\n[![Documentation Status](https://readthedocs.org/projects/pypsa/badge/?version=latest)](https://docs.pypsa.org/latest/?badge=latest)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/PyPSA/PyPSA/master.svg)](https://results.pre-commit.ci/latest/github/PyPSA/PyPSA/master)\n[![Code coverage](https://codecov.io/gh/PyPSA/PyPSA/branch/master/graph/badge.svg?token=kCpwJiV6Jr)](https://codecov.io/gh/PyPSA/PyPSA)\n[![REUSE status](https://api.reuse.software/badge/github.com/pypsa/pypsa)](https://api.reuse.software/info/github.com/pypsa/pypsa)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![License](https://img.shields.io/pypi/l/pypsa.svg)](LICENSE)\n[![Zenodo](https://zenodo.org/badge/DOI/10.5281/zenodo.3946412.svg)](https://doi.org/10.5281/zenodo.3946412)\n[![Discord](https://img.shields.io/discord/911692131440148490?logo=discord)](https://discord.gg/AnuJBk23FU)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n\nPyPSA stands for **Python for Power System Analysis**. It is pronounced\n**pipes-ah**.\n\nPyPSA is an open-source Python framework for optimising and simulating modern\npower and energy systems that include features such as conventional generators\nwith unit commitment, variable wind and solar generation, hydro-electricity,\ninter-temporal storage, coupling to other energy sectors, elastic demands, and\nlinearised power flow with loss approximations in DC and AC networks. PyPSA is\ndesigned to scale well with large networks and long time series. It is made for\nresearchers, planners and utilities with basic coding aptitude who need a fast,\neasy-to-use and transparent tool for power and energy system analysis.\n\n\u003e [!NOTE]\n\u003e PyPSA has many contributors, with the maintenance led by the [Department of Digital Transformation in\n\u003e Energy Systems](https://tu.berlin/en/ensys) at the [Technical University of\n\u003e Berlin](https://www.tu.berlin).  The project is currently supported by the\n\u003e [German Research Foundation](https://www.dfg.de/en/)\n\u003e (grant number [`528775426`](https://gepris.dfg.de/gepris/projekt/528775426)).\n\u003e Previous versions were developed at the [Karlsruhe\n\u003e Institute of Technology](http://www.kit.edu/english/index.php) funded by the\n\u003e [Helmholtz Association](https://www.helmholtz.de/en/), and\n\u003e at [FIAS](https://fias.uni-frankfurt.de/) funded by the [German Federal\n\u003e Ministry for Education and Research (BMBF)](https://www.bmbf.de/bmbf/en/).\n\n## Features\n\n- **Economic Dispatch (ED):** Models short-term market-based dispatch including\nunit commitment, renewable availability, short-duration and seasonal storage\nincluding hydro reservoirs with inflow and spillage dynamics, elastic demands,\nload shedding and conversion between energy carriers, using either perfect\noperational foresight or rolling horizon time resolution.\n\n- **Linear Optimal Power Flow (LOPF):** Extends economic dispatch to determine\nthe least-cost dispatch while respecting network constraints in meshed AC-DC\nnetworks, using a linearised representation of power flow (KVL, KCL) with\noptional loss approximations.\n\n- **Security-Constrained LOPF (SCLOPF):** Extends LOPF by accounting for line\noutage contingencies to ensure system reliability under $N-1$ conditions.\n\n- **Capacity Expansion Planning (CEP):** Supports least-cost\nlong-term system planning with investment decisions for generation, storage,\nconversion, and transmission infrastructure. Handles both single and multiple\ninvestment periods. Continuous and discrete investments are supported.\n\n- **Pathway Planning:** Supports co-optimisation of multiple investment periods to\nplan energy system transitions over time with perfect planning foresight.\n\n- **Stochastic Optimisation:** Implements two-stage stochastic programming\nframework with scenario-weighted uncertain inputs, with investments as\nfirst-stage decisions and dispatch as recourse decisions.\n\n- **Modelling-to-Generate-Alternatives (MGA):** Explores near-optimal decision\nspaces to provide insight into the range of feasible system configurations with\nsimilar costs.\n\n- **Sector-Coupling:** Modelling integrated energy systems with multiple energy\n  carriers (electricity, heat, hydrogen, etc.) and conversion between them.\n  Flexible representation of technologies such as heat pumps, electrolysers,\n  battery electric vehicles (BEVs), direct air capture (DAC), and synthetic\n  fuels production.\n\n- **Static Power Flow Analysis:** Computes both full non-linear and linearised\n  load flows for meshed AC and DC grids using Newton-Raphson method.\n\n## Documentation\n\nPyPSA has extensive [documentation](https://docs.pypsa.org) with tutorials, user guides, examples and an API reference.\n\n## Installation\n\npip:\n\n``` bash\npip install pypsa\n```\n\nconda/mamba:\n\n``` bash\nconda install -c conda-forge pypsa\n```\n\nuv:\n\n``` bash\nuv add pypsa\n```\n\n## Usage\n\n``` py\nimport pypsa\n\n# create a new network\nn = pypsa.Network()\nn.add(\"Bus\", \"mybus\")\nn.add(\"Load\", \"myload\", bus=\"mybus\", p_set=100)\nn.add(\"Generator\", \"mygen\", bus=\"mybus\", p_nom=100, marginal_cost=20)\n\n# load an example network\nn = pypsa.examples.ac_dc_meshed()\n\n# run the optimisation\nn.optimize()\n\n# plot results\nn.generators_t.p.plot()\nn.plot()\n\n# get statistics\nn.statistics()\nn.statistics.energy_balance()\n```\n\n## Dependencies\n\nPyPSA relies heavily on other open-source Python packages. Some of them are:\n\n* [pandas](http://pandas.pydata.org/) for storing data about components and time series\n* [numpy](http://www.numpy.org/) and [scipy](http://scipy.org/) for linear algebra and matrix calculations\n* [linopy](https://github.com/PyPSA/linopy) for preparing optimisation problems\n* [matplotlib](https://matplotlib.org/), [seaborn](https://seaborn.pydata.org/) and [plotly](https://plotly.com/python/) for static and interactive plotting\n* [networkx](https://networkx.github.io/) for network calculations\n* [pytest](http://pytest.org/) for unit testing\n\nFind the full list of dependencies in the [`pyproject.toml`](https://github.com/PyPSA/PyPSA/blob/master/pyproject.toml) file.\n\nPyPSA can be used with different solvers. For instance, the free solvers\n[HiGHS](https://highs.dev/) (installed by default), [GLPK](https://www.gnu.org/software/glpk/) and\n[CBC](https://github.com/coin-or/Cbc/) or commercial solvers like\n[Gurobi](http://www.gurobi.com/) or [FICO Xpress](https://www.fico.com/en/products/fico-xpress-optimization) for which free academic licenses are available.\n\n## Contributing and Support\n\nWe strongly welcome anyone interested in contributing to this project. If you have any ideas, suggestions or encounter problems, feel invited to file issues or make pull requests on GitHub.\n\n-   To **discuss** with other PyPSA users, organise projects, share news, and get in touch with the community you can use the [Discord server](https://discord.gg/AnuJBk23FU).\n-   For **bugs and feature requests**, please [open an issue](https://github.com/PyPSA/PyPSA/issues).\n-   For **troubleshooting and support**, please check the [troubleshooting](https://docs.pypsa.org/latest/user-guide/support/) and [support](https://docs.pypsa.org/latest/user-guide/support/) sectionsin the documentation.\n\nDetailed guidelines can be found in the [Contributing](https://docs.pypsa.org/latest/contributing/contributing/) guidelines of our documentation.\n\n## Code of Conduct\n\nPlease respect our [Code of Conduct](https://docs.pypsa.org/latest/contributing/code-of-conduct/).\n\n## Citing PyPSA\n\nIf you use PyPSA for your research, we would appreciate it if you would\ncite the following paper:\n\n-   T. Brown, J. Hörsch, D. Schlachtberger, [PyPSA: Python for Power\n    System Analysis](https://arxiv.org/abs/1707.09913), 2018, [Journal\n    of Open Research\n    Software](https://openresearchsoftware.metajnl.com/), 6(1),\n    [arXiv:1707.09913](https://arxiv.org/abs/1707.09913),\n    [DOI:10.5334/jors.188](https://doi.org/10.5334/jors.188)\n\nPlease use the following BibTeX:\n\n    @article{PyPSA,\n       author = {T. Brown and J. H\\\"orsch and D. Schlachtberger},\n       title = {{PyPSA: Python for Power System Analysis}},\n       journal = {Journal of Open Research Software},\n       volume = {6},\n       issue = {1},\n       number = {4},\n       year = {2018},\n       eprint = {1707.09913},\n       url = {https://doi.org/10.5334/jors.188},\n       doi = {10.5334/jors.188}\n    }\n\nIf you want to cite a specific PyPSA version, each release of PyPSA is archived\non [Zenodo](https://zenodo.org/) with a release-specific DOI:\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3946412.svg)](https://doi.org/10.5281/zenodo.3946412)\n\n## Licence\n\nCopyright [PyPSA Contributors](https://docs.pypsa.org/latest/contributing/contributors/)\n\nPyPSA is licensed under the open source [MIT License](LICENSES/MIT.txt).\nThe documentation is licensed under [CC-BY-4.0](LICENSES/CC-BY-4.0.txt).\n\nThe repository uses [REUSE](https://reuse.software/) to expose the licenses of its files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypsa%2Fpypsa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpypsa%2Fpypsa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypsa%2Fpypsa/lists"}