Skip to main content

Data hub for pandapower and pandapipes networks based on MongoDB

Project description

pandapower pandapipes

pandahub pandahub pandahub

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:

  1. Start a MongoDB on localhost:27017 (or another custom port)

  2. 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.py
    

    or 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.py
    

    The 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 .env file in pandahub/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

  1. 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-login in 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.

  2. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandahub-0.1.3.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandahub-0.1.3-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file pandahub-0.1.3.tar.gz.

File metadata

  • Download URL: pandahub-0.1.3.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.10.0 keyring/23.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for pandahub-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8215f425eafc3d4956ea93efd2ec9969bc8b6f6dbfb2f1b63221f2f5c1d46e3d
MD5 99dbc88f7b78e4070ebc2d54880cf32f
BLAKE2b-256 be4da8b708ed1d6fb44a721188d99f6dd2d54f993fad2b1e7f7930a24f41a18c

See more details on using hashes here.

File details

Details for the file pandahub-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pandahub-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.0 importlib-metadata/4.10.0 keyring/23.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for pandahub-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8bb0c0ece5682131d257950b34eae031962430c1bc2faed49baf54ea163d7806
MD5 db55278ae0438f95d8b47dc6dd5f3148
BLAKE2b-256 87188fb362a525e3f6f63030efc17baf493e0318e8157f2f92df350508b8afa0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page