Skip to main content

Kisters 液压网络存储服务的客户端库

项目描述

液压网络客户端库

该库允许连接到远程液压网络 REST 服务器。它支持使用 OpenID Connect 进行身份验证。

安装

安装pip

> python -m pip install kisters.water.hydraulic_network.client

示例用法

创建 Kisters REST 客户端

from kisters.water.rest_client import RESTClient
from kisters.water.rest_client.auth import OpenIDConnect


rest_client = RESTClient(
    url="https://jesse-test.hydraulic-network.kisters.cloud",
    authentication=OpenIDConnect(
        client_id="jesse-test",
        client_secret="c4b0f70d-d2e6-497f-b11c-d49fe806c29b",
    ),
)

# Verify the client is set up correctly
# Note: If you have not created any networks yet, this could be an empty list
rest_client.get(("rest", "networks"))
# ['my-network', 'my-other-network', ...]

连接到网络

from kisters.water.hydraulic_network.client import Network

# Instantiate the Network class with the network name and client
network = Network("my-network", rest_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})
# ,
# ...
# ]

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

kisters.water.hydraulic_network.client-0.1.0.tar.gz (17.9 kB 查看哈希

已上传 source

内置分布

kisters.water.hydraulic_network.client-0.1.0-py3-none-any.whl (13.9 kB 查看哈希

已上传 py3