Client library for the Kisters Hydraulic Network Storage service
Project description
Hydraulic Network Client Library
This library allows connections to remote hydraulic network REST servers. It supports authentication with OpenID Connect.
Installation
Install with pip
:
> python -m pip install kisters.water.hydraulic_network.client
Example Usage
Create Client
from kisters.water.hydraulic_network.client import (
OpenIDConnect, # provides authentication tokens for the client
RESTClient, # communicates with a network store service
)
# Instantiate the authentication class with credentials
authentication = OpenIDConnect(
issuer_url="https://auth.kisters.cloud/auth/realms/external",
client_id="jesse-test",
client_secret="c4b0f70d-d2e6-497f-b11c-d49fe806c29b",
)
# Instantiate the client class with the service url and authentication
client = RESTClient(
url="https://jesse-test.hydraulic-network.kisters.cloud/",
authentication=authentication
)
# Verify the client is set up correctly
# Note: If you have not created any networks yet, this could be an empty list
client.get(("rest", "networks"))
# ['my-network', 'my-other-network', ...]
Connect to a Network
from kisters.water.hydraulic_network.client import Network
# Instantiate the Network class with the network name and client
network = Network("my-network", client)
# You can now access the properties of the network
network.get_nodes()
# [
# FlowBoundary(
# created=datetime.datetime(2019, 6, 27, 16, 53, 5),
# uid='flow_boundary',
# display_name='flow_boundary',
# location={'x': 0.0, 'y': 0.0, 'z': 0.0},
# schematic_location={'x': 0.0, 'y': 0.0, 'z': 0.0})
# ,
# ...
# ]
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
Built Distribution
Close
Hashes for kisters.water.hydraulic_network.client-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 787956962c4c2b2b8002b91d6e0022500cd55b53e7927843fbec93bdd56e6b08 |
|
MD5 | 618fe3ebdab307977cf9c36b3efd50a1 |
|
BLAKE2b-256 | 718ce2b1a33e000870583a4a17d705f4594c05a54523a16400fef06eda52cb28 |
Close
Hashes for kisters.water.hydraulic_network.client-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5e029d7268525769801c569f2b962ccf2f14db902a3621c3ea44f8c5870b181 |
|
MD5 | b68ac02ae25ebac76911f3be1bd6b7d5 |
|
BLAKE2b-256 | 24c4005078c9e56e4d1806f72904fcfdc1ca9cb15560b7853a671e80235729e6 |