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.104.0.tar.gz (554.5 kB view details)

Uploaded Source

Built Distribution

cognite_power_ops-0.104.0-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cognite_power_ops-0.104.0.tar.gz
  • Upload date:
  • Size: 554.5 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.104.0.tar.gz
Algorithm Hash digest
SHA256 64e0e736c9a95f4f7a511038ac59b3331549b92cc4f280c08a987161ba22f142
MD5 be379515445c396fa29136b38ca38930
BLAKE2b-256 57b258cf6d0e30642cf6a0dc85bc45ae15ef641663f2be96ca6b68729658b159

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cognite_power_ops-0.104.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65a1870346291babba593b2a8253b50b07f4d54994a6299ea744838e0a3ab642
MD5 3bda2f8379ed814c124af0ea5281fa0b
BLAKE2b-256 4617ee786188b25cf9fa2f27c15a19e8305983874545b9db5ecb7ae57eb43985

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