pandahub is a data hub for pandapower and pandapipes networks based on MongoDB. It allows you to store pandapower and pandapipes networks as well as timeseries in a MongoDB. pandahub allows you to access the database directly for local development, but also includes a client/server architecture that exposes all relevant methods as an API based on FastAPI. Access through the API is managed with a user management implementation based on FastAPI Users.
Setup a local pandahub api
Steps to test the client/server structure locally:
-
Start a MongoDB on localhost:27017 (or another custom port)
-
Start the uvicorn server that exposes the API by navigating to "pandahub/api" and running:
# windows set SECRET=secret & python main.py # linux SECRET=secret python main.pyor if you don't run mongodb on the default port (27017)
# windows set MONGODB_URL=mongodb://localhost:[mongo-port] & set SECRET=secret & python main.py # linux MONGODB_URL=mongodb://localhost:[mongo-port] SECRET=secret python main.pyThe API should now run on http://localhost:8002
Note A full documentation of all api endpoints can be seen at http://localhost:8002/docs
Note 2 You can avoid always setting the environment variables for SECRET and MONGODB_URL by creating an
.envfile inpandahub/api/with the following content:SECRET=secret MONGODB_URL=mongodb://localhost:[mongo-port]
Develop with Docker
docker compose up starts a mongodb container alongside pandahub with live reload available at http://localhost:8002.
If you want to connect to a running database, set the database url and specify only docker-compose.yml:
MONGODB_URL=mongodb://localhost:[mongo-port] docker compose -f docker-compose.yml up
Use pandahub api with pandahub client
-
Login with the pandahub client
There are two ways to login with pandahub client
- If you installed pandahub by pip or with setup.py just run
pandahub-loginin your shell.
OR
- Run the following in your python or IPython shell:
from pandahub.client.user_management import login login()This will guide you through the login process.
- If you installed pandahub by pip or with setup.py just run
-
You only need to login once. After you logged in successfully a configuration file (pandahub.config) containing an authentication token is created in your home directory and will be used every time you use the pandahub client. You only need to login again if you want to use a different instance of the pandahub api.
Metadata
Release files for pandahub 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pandahub-0.2.0.tar.gz | 29.5 kB | Without provenance | Details for pandahub-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pandahub-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pandahub-0.2.0-py3-none-any.whl |
Total release size: 65.6 kB
Release files / pandahub-0.2.0.tar.gz
| Download URL | pandahub-0.2.0.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea21c0c47bcc2c72a8f9b316d17766cf7a27b1c1b71ad1450633138adcff6c32
|
|
BLAKE2b-256 checksum How to use checksums |
ce4d69420b5dffb250384f21f66c447e4094b94cab9db9af836209a38c70d584
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.9
|
Release files / pandahub-0.2.0-py3-none-any.whl
| Download URL | pandahub-0.2.0-py3-none-any.whl |
|---|---|
| Size | 36.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5aaa15b5ea4ee8b480e934e4cec785022810406ac20a94652b57a3428b0c675f
|
|
BLAKE2b-256 checksum How to use checksums |
0edb67c3d81d486b59b68c7968106c870bd3a027c7cb560434f7689c7ee7fe4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.9
|
Security for pandahub 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.