{"id":15032529,"url":"https://github.com/pypsa/pypsa","last_synced_at":"2025-05-13T17:09:47.924Z","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":"2025-05-13T17:09:47.861Z","avatar_url":"https://github.com/PyPSA.png","language":"Python","readme":"# 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://pypsa.readthedocs.io/en/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[![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.txt)\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 toolbox for simulating and optimising modern power and\nenergy systems that include features such as conventional generators with unit\ncommitment, variable wind and solar generation, storage units, coupling to other\nenergy sectors, and mixed alternating and direct current networks. PyPSA is\ndesigned to scale well with large networks and long time series.\n\nThis project is maintained by the [Department of Digital Transformation in\nEnergy Systems](https://www.tu.berlin/ensys) at the [Technical University of\nBerlin](https://www.tu.berlin). Previous versions were developed by the Energy\nSystem Modelling group at the [Institute for Automation and Applied\nInformatics](https://www.iai.kit.edu/english/index.php) at the [Karlsruhe\nInstitute of Technology](http://www.kit.edu/english/index.php) funded by the\n[Helmholtz Association](https://www.helmholtz.de/en/), and by the [Renewable\nEnergy\nGroup](https://fias.uni-frankfurt.de/physics/schramm/renewable-energy-system-and-network-analysis/)\nat [FIAS](https://fias.uni-frankfurt.de/en/) to carry out simulations for the\n[CoNDyNet project](https://fias.institute/en/projects/condynet/), financed by the [German Federal\nMinistry for Education and Research (BMBF)](https://www.bmbf.de/bmbf/en/)\nas part of the [Stromnetze Research\nInitiative](http://forschung-stromnetze.info/projekte/grundlagen-und-konzepte-fuer-effiziente-dezentrale-stromnetze/).\n\n## Functionality\n\nPyPSA can calculate:\n\n-   static power flow (using both the full non-linear network equations and the\n    linearised network equations)\n-   linear optimal power flow (least-cost optimisation of power plant and\n    storage dispatch within network constraints, using the linear network\n    equations, over several snapshots)\n-   security-constrained linear optimal power flow\n-   total electricity/energy system least-cost investment optimisation (using\n    linear network equations, over several snapshots and investment periods\n    simultaneously for optimisation of generation and storage dispatch and\n    investment in the capacities of generation, storage, transmission and other\n    infrastructure)\n\nIt has models for:\n\n-   meshed multiply-connected AC and DC networks, with controllable converters\n    between AC and DC networks\n-   standard types for lines and transformers following the implementation in\n    [pandapower](https://www.pandapower.org/)\n-   conventional dispatchable generators and links with unit commitment\n-   generators with time-varying power availability, such as wind and solar\n    generators\n-   storage units with efficiency losses\n-   simple hydroelectricity with inflow and spillage\n-   coupling with other energy carriers (e.g. resistive Power-to-Heat (P2H),\n    Power-to-Gas (P2G), battery electric vehicles (BEVs), Fischer-Tropsch,\n    direct air capture (DAC))\n-   basic components out of which more complicated assets can be built, such as\n    Combined Heat and Power (CHP) units and heat pumps.\n\n## Documentation\n\n* [Documentation](https://pypsa.readthedocs.io/en/latest/index.html)\n\n    * [Quick start](https://pypsa.readthedocs.io/en/latest/quick_start.html)\n\n    * [Examples](https://pypsa.readthedocs.io/en/latest/examples-index/lopf.html)\n\n    * [Known users of PyPSA](https://pypsa.readthedocs.io/en/latest/users.html)\n\n## Installation\n\npip:\n\n```pip install pypsa```\n\nconda/mamba:\n\n```conda install -c conda-forge pypsa```\n\nAdditionally, install a solver (see [here](https://pypsa.readthedocs.io/en/latest/getting-started/installation.html#getting-a-solver)).\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\nThere are [more extensive\nexamples](https://pypsa.readthedocs.io/en/latest/examples-basic.html) available\nas [Jupyter notebooks](https://jupyter.org/). They are also available as Python scripts in\n[examples/notebooks/](examples/notebooks/) directory.\n\n## Screenshots\n\n[PyPSA-Eur](https://github.com/PyPSA/pypsa-eur) optimising capacities of\ngeneration, storage and transmission lines (9% line volume expansion allowed)\nfor a 95% reduction in CO2 emissions in Europe compared to 1990 levels\n\n![image](doc/img/elec_s_256_lv1.09_Co2L-3H.png)\n\n[SciGRID model](https://power.scigrid.de/) simulating the German power system\nfor 2015.\n\n![image](doc/img/stacked-gen_and_storage-scigrid.png)\n\n![image](doc/img/lmp_and_line-loading.png)\n\n## Dependencies\n\nPyPSA is written and tested to be compatible with Python 3.10 and above.\nThe last release supporting Python 2.7 was PyPSA 0.15.0.\n\nIt leans heavily on the following Python packages:\n\n-   [pandas](http://pandas.pydata.org/) for storing data about\n    components and time series\n-   [numpy](http://www.numpy.org/) and [scipy](http://scipy.org/) for\n    calculations, such as linear algebra and sparse matrix calculations\n-   [networkx](https://networkx.org/) for some network\n    calculations\n-   [matplotlib](https://matplotlib.org/) for static plotting\n-   [linopy](https://github.com/PyPSA/linopy) for preparing optimisation problems\n    (currently only linear and mixed integer linear optimisation)\n-   [cartopy](https://scitools.org.uk/cartopy) for plotting the\n    baselayer map\n-   [pytest](https://docs.pytest.org/) for unit testing\n-   [logging](https://docs.python.org/3/library/logging.html) for\n    managing messages\n\nFind the full list of dependencies in the \n[dependency graph](https://github.com/PyPSA/PyPSA/network/dependencies).\n\nThe optimisation uses interface libraries like `linopy` which are independent of\nthe preferred solver. You can use e.g. one of the free solvers\n[HiGHS](https://highs.dev/), [GLPK](https://www.gnu.org/software/glpk/) and\n[CLP/CBC](https://github.com/coin-or/Cbc/) or the commercial solver\n[Gurobi](http://www.gurobi.com/) 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 use the [PyPSA Github Issues page](https://github.com/PyPSA/PyPSA/issues).\n-   For **troubleshooting**, please check the [troubleshooting](https://pypsa.readthedocs.io/en/latest/troubleshooting.html) in the documentation.\n\nDetailed guidelines can be found in the [Contributing](https://pypsa.readthedocs.io/en/latest/contributing.html) section of our documentation.\n\n## Code of Conduct\n\nPlease respect our [code of conduct](CODE_OF_CONDUCT.md).\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\nstored on [Zenodo](https://zenodo.org/) with a release-specific DOI. The\nrelease-specific DOIs can be found linked from the overall PyPSA Zenodo\nDOI for Version 0.17.1 and onwards:\n\n[![image](https://zenodo.org/badge/DOI/10.5281/zenodo.3946412.svg)](https://doi.org/10.5281/zenodo.3946412)\n\nor from the overall PyPSA Zenodo DOI for Versions up to 0.17.0:\n\n[![image](https://zenodo.org/badge/DOI/10.5281/zenodo.786605.svg)](https://doi.org/10.5281/zenodo.786605)\n\n# Licence\n\nCopyright 2015-2025 [PyPSA\nDevelopers](https://pypsa.readthedocs.io/en/latest/developers.html)\n\nPyPSA is licensed under the open source [MIT\nLicense](https://github.com/PyPSA/PyPSA/blob/master/LICENSE.txt).\n","funding_links":[],"categories":[],"sub_categories":[],"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"}