SDK for power markets operations on Cognite Data Fusion
Project description
Welcome to PowerOps SDK
What is it?
The PowerOps SDK is a domain-specific SDK for interacting with Cognite Data Fusion (CDF) for the power operations' domain. Requires PowerOps to be deployed and configured for CDF project before using, see project setup instructions for more details.
Main Features
cognite.powerops.client.PowerOpsClientused to interact with CDF in a domain-specific language.- Resource Sync,
resync, used to sync configuration files with CDF through the CLI toolpowerops.
Installation
pip install cognite-power-ops
Configuration
Configuration of the PowerOpsClient and resync is done through a yaml file and environment variables.
YAML configuration
The configuration is in .yaml format and the path to the configuration file must be explicitly provided. Refer to the example config file for the most up to date example of required fields.
Secrets should not be written directly in this configuration file as the file is intended to be committed to git. Instead use the following syntax to refer to an environment variable as a value.
project: "${PROJECT}"
base_url: "https://${CLUSTER}.cognitedata.com"
If you are using a .env file etc. then you must handle loading the proper environment variables prior to instantiating PowerOpsClient or running resync.
Usage
Run Resync
Refer to the resync documentation.
PowerOpsClient
Using YAML configuration:
from dotenv import load_dotenv
from cognite.powerops.client import PowerOpsClient
load_dotenv()
power_ops_client = PowerOpsClient.from_config("power_ops_config.yaml")
Using an existing CogniteClient:
from cognite.powerops.client import PowerOpsClient
# Refer to the Cognite SDK documentation for the different ways to instantiate a CogniteClient
cognite_config = {} # dict with configuration
cognite_client = CogniteClient.load(cognite_config)
# Instantiate PowerOpsClient with existing CogniteClient
power_ops_client = PowerOpsClient(client=cognite_client, read_dataset="xid_dataset", write_dataset="xid_dataset")
For more examples on using the PowerOpsClient, see the examples section of the documentation.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cognite_power_ops-1.1.6.tar.gz.
File metadata
- Download URL: cognite_power_ops-1.1.6.tar.gz
- Upload date:
- Size: 297.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8170bc441e6fbee46fe1959ba1e63e701449b9d62d0383ae5109153084585719
|
|
| MD5 |
4358c97a19377d5d7f1d209991029ab1
|
|
| BLAKE2b-256 |
a31e034d45817a412dd43e21ba39078656ef9fc555ffadad85727c98f237ad96
|
File details
Details for the file cognite_power_ops-1.1.6-py3-none-any.whl.
File metadata
- Download URL: cognite_power_ops-1.1.6-py3-none-any.whl
- Upload date:
- Size: 610.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1149dfef03b32ee5d92f2b0ec92a3fc5ef6f8ee2f100baa48b5c7fdec52f15d
|
|
| MD5 |
34197677f6375ec21bee5f3d2d13819e
|
|
| BLAKE2b-256 |
57fc542cf7377c1c33b91b970b6774dd1896a8ac47311306d7e3ecba2318e035
|