Skip to main content

Industrial Model Client Generator

Project description

🏭 Industrial Model Client Generator

A utility for generating client-specific configurations for industrial data models

📦 Overview

The industrial_model_client_generator package automates the generation of client configurations based on a set of input definitions.

🚀 Installation

pip install industrial-model-client-generator

⚙️ Configuration Guide

This project requires a generator-config.yaml file to be placed in the root directory where the script is executed. This file contains environment-specific settings such as Cognite credentials, data model configuration, and instance space mappings.

Creating generator-config.yaml

client_name: "TestingClientV2"
output_path: "output" # not required
client_mode: "async" # options: both, async, sync

cognite:
  project: "${CDF_PROJECT}"
  client_name: "${CDF_CLIENT_NAME}"
  base_url: "https://${CDF_CLUSTER}.cognitedata.com"
  credentials:
    client_credentials:
      token_url: "${CDF_TOKEN_URL}"
      client_id: "${CDF_CLIENT_ID}"
      client_secret: "${CDF_CLIENT_SECRET}"
      scopes: ["https://${CDF_CLUSTER}.cognitedata.com/.default"]

data_model:
  external_id: "${CDF_DATA_MODEL_EXTERNAL_ID}"
  space: "${CDF_DATA_MODEL_SPACE}"
  version: "${CDF_DATA_MODEL_VERSION}"

instance_space_configs: # not required
  - view_or_space_external_id: "GENERIC-COR-ALL-DMD"
    instance_spaces:
      - "REF-COR-ALL-DAT"
  - view_or_space_external_id: "Equipment"
    instance_spaces:
      - "SAP-"
  - view_or_space_external_id: "FunctionalLocation"
    instance_spaces:
      - "SAP-"

🔐 Setting the Variables

Option: .env File (Recommended)

Create a file named .env in the root of your project:

CDF_PROJECT=cognite-dev
CDF_CLIENT_NAME=testing
CDF_CLUSTER=az-eastus-1
CDF_TOKEN_URL=https://login.microsoftonline.com/xxxx/oauth2/v2.0/token
CDF_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CDF_CLIENT_SECRET=your-client-secret
CDF_DATA_MODEL_EXTERNAL_ID=CogniteCore
CDF_DATA_MODEL_SPACE=cdf_cdm
CDF_DATA_MODEL_VERSION=v1

🚀 Usage

from industrial_model_client_generator import generate

generate()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

industrial_model_client_generator-0.1.5.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file industrial_model_client_generator-0.1.5.tar.gz.

File metadata

File hashes

Hashes for industrial_model_client_generator-0.1.5.tar.gz
Algorithm Hash digest
SHA256 5ec9fb2ec26a9c2235f2ddcef4e939b71c03361c82254da1efdcaed8c3490e1d
MD5 d136ce3584c467bfd3ec4b3e108ef740
BLAKE2b-256 37e67a82d07d6f538fdc7d81f5a7d82c2608c3da6104db8a09ad9faa23ea8230

See more details on using hashes here.

File details

Details for the file industrial_model_client_generator-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for industrial_model_client_generator-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cc0c5aab3a6702d9d86b0a441fbaac57ced7723144aff99db7f767a8aa3570b1
MD5 ce6178024ce089b21f9824bdcf6c6a53
BLAKE2b-256 8e107c12464520c49390c312e13793a3da7e10b5de7e01830be06bc39e3d71e7

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