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

cognite_power_ops-0.103.0.tar.gz (647.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cognite_power_ops-0.103.0.tar.gz
  • Upload date:
  • Size: 647.9 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.103.0.tar.gz
Algorithm Hash digest
SHA256 266d70f5d116a3116fe8c515123bd41430537548efb0f59f8f718eb2829d9d17
MD5 2897314c63c6c2cd787723256fd85d90
BLAKE2b-256 92e43f840d65107f2dab01e7ab8c00347ccd0ecb38c930a0d4a0e30d27e212a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cognite_power_ops-0.103.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fca295e86f852ff5e5a6da2a33f6b7fa65f327b999175b69b8370ca9bf1ead8b
MD5 2fb09446d194978a93822857822aa6ba
BLAKE2b-256 7e626847f67a9dffc094e81bf0891cf42904f934bdc54d869995f52c854a3bdb

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