Grid load simulation REST API based on Pandapower
docker run -p 80:80 pauldepraz/pandapowerapi
Once running click here to access the Swagger UI to interact with the API.
Alternatively, interact with the API use Insomnia.rest and import the Insomnia Workspace from the docs/
folder to hit the ground running!
Alternatively, use curl or httpie on the cmd.
http 127.0.0.1/api/v1/simulations
http 127.0.0.1/api/v1/simulation/0/load/active
http 127.0.0.1/api/v1/simulation/0/load/reactive
http post 127.0.0.1/api/v1/simulations
http 127.0.0.1/api/v1/simulation/1
http delete 127.0.0.1/api/v1/simulation/0
http 127.0.0.1/api/v1/simulation/0
http post 127.0.0.1/api/v1/simulations active=0.6 reactive=0.9
http post 127.0.0.1/api/v1/simulations active=0.2 reactive=0.01
http put 127.0.0.1/api/v1/simulation/2 active=0.2 reactive=0.05
http 127.0.0.1/api/v1/simulation/2/load/active
http 127.0.0.1/api/v1/simulation/2/load/reactive
- Build and test pipeline on Github Actions for all commits
- Dockerhub automated builds will update the
latest
tag for changes on themaster
branch
Run on the already installed Gunicorn wsgi server.
virutalenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
gunicorn -b 0.0.0.0:80 api.server:rest
For wsgi alternatives check Flask documentation here.
These commands will run all the tests, static analysis, code audit and display coverage.
Powered by pytest test framework, pylama code audit tool, and coveragepy.
coverage run -m pytest --pylama && coverage report && coverage-badge -o docs/coverage.svg
Build a local docker image.
docker build -t pauldepraz/pandapowerapi -f Dockerfile.alpine .
Run the container and map the internal ports to host.
docker run -p 80:80/tcp pauldepraz/pandapowerapi