Skip to content

Commit

Permalink
remove PandaHubClient
Browse files Browse the repository at this point in the history
  • Loading branch information
jthurner committed Jul 24, 2024
1 parent 30fba2e commit 051232a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 281 deletions.
28 changes: 3 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

[![pandahub](https://badge.fury.io/py/pandahub.svg)](https://pypi.org/project/pandahub/) [![pandahub](https://img.shields.io/pypi/pyversions/pandahub.svg)](https://pypi.org/project/pandahub/) [![pandahub](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/e2nIEE/pandahub/blob/master/LICENSE)


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.
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 through the PandaHub class,
but also provides a REST-API based on FastAPI. Access through the API is managed with a user management implementation based on FastAPI Users.

## Setup a local pandahub api

Expand Down Expand Up @@ -50,26 +51,3 @@ Steps to test the client/server structure locally:
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.
1 change: 0 additions & 1 deletion pandahub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
__version__ = importlib.metadata.version("pandahub")

from pandahub.lib.PandaHub import PandaHub, PandaHubError
from pandahub.client.PandaHubClient import PandaHubClient
149 changes: 0 additions & 149 deletions pandahub/client/PandaHubClient.py

This file was deleted.

Empty file removed pandahub/client/__init__.py
Empty file.
56 changes: 0 additions & 56 deletions pandahub/client/user_management.py

This file was deleted.

27 changes: 0 additions & 27 deletions pandahub/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from pandahub import PandaHub
from pandahub import PandaHubClient
from pandahub.api.internal import settings

@pytest.fixture(scope="session")
Expand All @@ -21,29 +20,3 @@ def ph():
ph.delete_project(i_know_this_action_is_final=True)


@pytest.fixture(scope="session")
def phc():
url = settings.PANDAHUB_SERVER_URL

if url == "0.0.0.0":
url = "127.0.0.1"

phc = PandaHubClient(
config={
"url": f"http://{url}:{settings.PANDAHUB_SERVER_PORT}",
"token": settings.SECRET
}
)

project_name = "pandahubclienttest"

#if phc.project_exists(project_name):
# phc.set_active_project(project_name)
# phc.delete_project(i_know_this_action_is_final=True)

phc.create_project(name=project_name)
phc.set_active_project(project_name)

yield phc

phc.delete_project(i_know_this_action_is_final=True)
23 changes: 0 additions & 23 deletions pandahub/test/test_client.py

This file was deleted.

0 comments on commit 051232a

Please sign in to comment.