Skip to main content

SDK for power markets operations on Cognite Data Fusion

Project description

Welcome to PowerOps SDK

release Documentation Status Github PyPI Downloads GitHub Code style: black Ruff mypy

What is it?

The PowerOps SDK is a domain-specific SDK for interacting with Cognite Data Fusion (CDF) for the power operations' domain.

Main Features

  • cognite.powerops.client.PowerOpsClient used to interact with CDF in a domain-specific language.
  • Resource Sync, resync, used to sync configuration files with CDF through the CLI tool powerops.

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()
client = PowerOpsClient.from_config("power_ops_config.yaml")

client.shop.runs.trigger()

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

cognite_power_ops-0.102.3.tar.gz (645.3 kB view details)

Uploaded Source

Built Distribution

cognite_power_ops-0.102.3-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file cognite_power_ops-0.102.3.tar.gz.

File metadata

  • Download URL: cognite_power_ops-0.102.3.tar.gz
  • Upload date:
  • Size: 645.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for cognite_power_ops-0.102.3.tar.gz
Algorithm Hash digest
SHA256 44411ea147976280ffd1fbc430d1b166075d5b8bfa6e5f7cf8dd9d63bd37b1a5
MD5 02ff3206198b35b76cb687c628b85dc5
BLAKE2b-256 d299f5b74ba9e92f63b0823507219f9345fa828f7611ca91302f0b696d30a26d

See more details on using hashes here.

File details

Details for the file cognite_power_ops-0.102.3-py3-none-any.whl.

File metadata

File hashes

Hashes for cognite_power_ops-0.102.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4d931ccd428eb236a1e4b0e762a6fa34bcaf05bad6526c695ce9dad5355c1b14
MD5 b692758ed7cc9f02fa94cfd8dc619bbc
BLAKE2b-256 d2b73eb28ac3456977072cc25a86b64db7c72211def6fb37dcc81e491d629c19

See more details on using hashes here.

Supported by

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