Skip to content

vfinel/nopywer

Repository files navigation

nopywer

Pronounced /noʊ.paɪ.wɛr/: "no-pie-wer" (as in no+ python + power)

Visit the homepage of the project: https://vfinel.github.io/nopywer/

Nopywer analyses power grids to compute current flowing through cables, 3-phase balance, and voltage drop. It also includes a cable-layout optimizer (MST + cost-based local search) exposed via a FastAPI server.

Setup

Requires Python ≥ 3.12 and uv.

uv venv
uv sync

This installs all runtime and dev dependencies (ruff, pytest, pre-commit…) in a local .venv.

Input data

Nopywer reads a GeoJSON file containing nodes and cables. A spreadsheet can optionally be provided for equipment inventory.

Usage

nopywer-analyze tests/fixtures/analyze_input.geojson -v

See nopywer-analyze --help for all options.

Environment variables

nopywer-analyze also reads these environment variables:

  • NOPYWER_INPUT: input GeoJSON path
  • NOPYWER_OUTPUT: output GeoJSON path
  • NOPYWER_INVENTORY: inventory spreadsheet path

Example:

export NOPYWER_INPUT=input.geojson
export NOPYWER_OUTPUT=output.geojson
export NOPYWER_INVENTORY=inventory.xlsx
nopywer-analyze

To start the companion API server:

nopywer-server

Opening http://localhost:8042/ shows a minimal embedded map.

nopywer frontend map screenshot

Contributing

Contributions are welcome! See also CONTRIBUTING.md for guidelines on reporting bugs, suggesting features, and submitting PRs.

Lint

The project uses ruff for linting and formatting (line length: 100, see pyproject.toml for the full config).

uv run ruff check .

Pre-commit hooks are configured to run ruff automatically on each commit. To install them:

uv run pre-commit install

Test

Tests use pytest.

uv run pytest

CI

A GitHub Actions workflow runs on every pull request and on pushes to main/develop. It checks:

  1. ruff check . — lint
  2. pytest — tests

Troubleshooting

If you have errors, please reach out (include the complete console output).

Disclaimer

While efforts have been made to ensure this project's functionality, it is provided "as is" without any warranties.

About

power grid design and analysis tools from geographic data with python and QGIS

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors