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

Uploaded Source

Built Distribution

cognite_power_ops-0.103.1-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cognite_power_ops-0.103.1.tar.gz
  • Upload date:
  • Size: 758.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.103.1.tar.gz
Algorithm Hash digest
SHA256 0981920b59f6824e2faae8727796e2ce86b5766e2ec2ca39740f75b3d139b673
MD5 ae7c0ef3430d8562eed024b1575d7e4d
BLAKE2b-256 6ee6c6e185ba778a5aa4edb092fede5c65f43ddbbe6ec6bf440589af92dd7dd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cognite_power_ops-0.103.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a879c23ccc3ca2f897e503ae55586918ba6c98964bd3ddc462f6620a582a8bfa
MD5 507cce8b51307086457eff1f00ab37ab
BLAKE2b-256 aea14d73f565be1d98cb95b23a55ecf511f0806eee7b3b40d76b6187157fadb6

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