# Welcome to PowerOps SDK
[![release](https://img.shields.io/github/actions/workflow/status/cognitedata/power-ops-sdk/release.yml?style=for-the-badge)](https://github.com/cognitedata/power-ops/actions/workflows/release.yml)
[![Documentation Status](https://readthedocs.com/projects/cognite-power-ops-sdk/badge/?version=latest&style=for-the-badge)](https://cognite-power-ops-sdk.readthedocs-hosted.com/en/latest/?badge=latest)
[![Github](https://shields.io/badge/github-cognite/power_ops_sdk-green?logo=github&style=for-the-badge)](https://github.com/cognitedata/power-ops-sdk)
[![PyPI](https://img.shields.io/pypi/v/cognite-power-ops?style=for-the-badge)](https://pypi.org/project/cognite-power-ops/)
[![Downloads](https://img.shields.io/pypi/dm/cognite-power-ops?style=for-the-badge)](https://pypistats.org/packages/cognite-power-ops)
[![GitHub](https://img.shields.io/github/license/cognitedata/power-ops-sdk?style=for-the-badge)](https://github.com/cognitedata/power-ops-sdk/blob/master/LICENSE)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/ambv/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=for-the-badge)](https://github.com/astral-sh/ruff)
[![mypy](https://img.shields.io/badge/mypy-checked-000000.svg?style=for-the-badge&color=blue)](http://mypy-lang.org)
## 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
```bash
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](power_ops_config.yaml) 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.
```yaml
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](RESYNC.md).
### PowerOpsClient
Using YAML configuration:
```python
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:
```python
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.
Raw data
{
"_id": null,
"home_page": "https://cognite-power-ops-sdk.readthedocs-hosted.com/en/latest/",
"name": "cognite-power-ops",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Cognite",
"author_email": "support@cognite.com",
"download_url": "https://files.pythonhosted.org/packages/84/64/911e8ba7ae3820bd9d5fbf8e59c788a2c8cb5f37b0fb05ba32e5e0273cb5/cognite_power_ops-0.107.0.tar.gz",
"platform": null,
"description": "# Welcome to PowerOps SDK\n\n[![release](https://img.shields.io/github/actions/workflow/status/cognitedata/power-ops-sdk/release.yml?style=for-the-badge)](https://github.com/cognitedata/power-ops/actions/workflows/release.yml)\n[![Documentation Status](https://readthedocs.com/projects/cognite-power-ops-sdk/badge/?version=latest&style=for-the-badge)](https://cognite-power-ops-sdk.readthedocs-hosted.com/en/latest/?badge=latest)\n[![Github](https://shields.io/badge/github-cognite/power_ops_sdk-green?logo=github&style=for-the-badge)](https://github.com/cognitedata/power-ops-sdk)\n[![PyPI](https://img.shields.io/pypi/v/cognite-power-ops?style=for-the-badge)](https://pypi.org/project/cognite-power-ops/)\n[![Downloads](https://img.shields.io/pypi/dm/cognite-power-ops?style=for-the-badge)](https://pypistats.org/packages/cognite-power-ops)\n[![GitHub](https://img.shields.io/github/license/cognitedata/power-ops-sdk?style=for-the-badge)](https://github.com/cognitedata/power-ops-sdk/blob/master/LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/ambv/black)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=for-the-badge)](https://github.com/astral-sh/ruff)\n[![mypy](https://img.shields.io/badge/mypy-checked-000000.svg?style=for-the-badge&color=blue)](http://mypy-lang.org)\n\n## What is it?\n\nThe PowerOps SDK is a domain-specific SDK for interacting with Cognite Data Fusion (CDF) for the power operations' domain.\n\n## Main Features\n\n* `cognite.powerops.client.PowerOpsClient` used to interact with CDF in a domain-specific language.\n* Resource Sync, `resync`, used to sync configuration files with CDF through the CLI tool `powerops`.\n\n## Installation\n\n```bash\npip install cognite-power-ops\n```\n\n## Configuration\n\nConfiguration of the `PowerOpsClient` and `resync` is done through a yaml file and environment variables.\n\n### YAML configuration\n\nThe configuration is in `.yaml` format and the path to the configuration file must be explicitly provided. Refer to the [example config file](power_ops_config.yaml) for the most up to date example of required fields.\n\nSecrets 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.\n\n```yaml\nproject: \"${PROJECT}\"\nbase_url: \"https://${CLUSTER}.cognitedata.com\"\n```\n\nIf you are using a `.env` file etc. then you must handle loading the proper environment variables prior to instantiating `PowerOpsClient` or running `resync`.\n\n## Usage\n\n### Run Resync\n\nRefer to the [resync documentation](RESYNC.md).\n\n### PowerOpsClient\n\nUsing YAML configuration:\n\n```python\nfrom dotenv import load_dotenv\nfrom cognite.powerops.client import PowerOpsClient\n\nload_dotenv()\npower_ops_client = PowerOpsClient.from_config(\"power_ops_config.yaml\")\n\n```\n\nUsing an existing CogniteClient:\n\n```python\nfrom cognite.powerops.client import PowerOpsClient\n\n# Refer to the Cognite SDK documentation for the different ways to instantiate a CogniteClient\ncognite_config = {} # dict with configuration\ncognite_client = CogniteClient.load(cognite_config)\n\n# Instantiate PowerOpsClient with existing CogniteClient\npower_ops_client = PowerOpsClient(client=cognite_client, read_dataset=\"xid_dataset\", write_dataset=\"xid_dataset\")\n\n```\n\nFor more examples on using the PowerOpsClient, see the examples section of the documentation.\n\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "SDK for power markets operations on Cognite Data Fusion",
"version": "0.107.0",
"project_urls": {
"Documentation": "https://cognite-power-ops-sdk.readthedocs-hosted.com/en/latest/",
"Homepage": "https://cognite-power-ops-sdk.readthedocs-hosted.com/en/latest/",
"Repository": "https://github.com/cognitedata/power-ops-sdk"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4be9f49bc78f79c06fe9ed24727a52885aeb5054484c6e57057c322193cafc6f",
"md5": "a8d538c78312d62c2c3dc321e55a2cc7",
"sha256": "260b2afa6b4c787bb4428c9bb5fe5991607c14f1879f4cb026c51985c5f54da7"
},
"downloads": -1,
"filename": "cognite_power_ops-0.107.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a8d538c78312d62c2c3dc321e55a2cc7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 1024242,
"upload_time": "2024-12-12T12:51:25",
"upload_time_iso_8601": "2024-12-12T12:51:25.184572Z",
"url": "https://files.pythonhosted.org/packages/4b/e9/f49bc78f79c06fe9ed24727a52885aeb5054484c6e57057c322193cafc6f/cognite_power_ops-0.107.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8464911e8ba7ae3820bd9d5fbf8e59c788a2c8cb5f37b0fb05ba32e5e0273cb5",
"md5": "46484640eac3c8e8e1b33f1be86df45e",
"sha256": "6921518506521fb10d15c48f62bca9dde57f05b409f046aaa4338fa7d416a572"
},
"downloads": -1,
"filename": "cognite_power_ops-0.107.0.tar.gz",
"has_sig": false,
"md5_digest": "46484640eac3c8e8e1b33f1be86df45e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 561501,
"upload_time": "2024-12-12T12:51:28",
"upload_time_iso_8601": "2024-12-12T12:51:28.269703Z",
"url": "https://files.pythonhosted.org/packages/84/64/911e8ba7ae3820bd9d5fbf8e59c788a2c8cb5f37b0fb05ba32e5e0273cb5/cognite_power_ops-0.107.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 12:51:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cognitedata",
"github_project": "power-ops-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cognite-power-ops"
}