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. Requires PowerOps to be deployed and configured for CDF project before using, see project setup instructions for more details.

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cognite_power_ops-1.1.6-py3-none-any.whl (610.5 kB view details)

Uploaded Python 3

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

Hashes for cognite_power_ops-1.1.6.tar.gz
Algorithm Hash digest
SHA256 8170bc441e6fbee46fe1959ba1e63e701449b9d62d0383ae5109153084585719
MD5 4358c97a19377d5d7f1d209991029ab1
BLAKE2b-256 a31e034d45817a412dd43e21ba39078656ef9fc555ffadad85727c98f237ad96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cognite_power_ops-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f1149dfef03b32ee5d92f2b0ec92a3fc5ef6f8ee2f100baa48b5c7fdec52f15d
MD5 34197677f6375ec21bee5f3d2d13819e
BLAKE2b-256 57fc542cf7377c1c33b91b970b6774dd1896a8ac47311306d7e3ecba2318e035

See more details on using hashes here.

Supported by

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