OpenGate Data Python
Opengate-data
This reference is generated from the docstrings of opengate-data 1.15.3.
Opengate-data is a Python library (requires Python 3.10+) that helps you integrate OpenGate into your Python projects.
Installation
To install the library, run:
Or, if you are using uv:
Quick Start: Searching Entities
Here is a simple example of how to search for entities using the EntitiesSearchBuilder:
Basic use with user and password
To initialize the OpenGateClient using a username and password:
Basic use with api-key
To initialize the client using an api_key:
Basic use token_jwt with .env
To initialize the client using a token_jwt with a .env file.
-
Create a .env file with the following content:
TOKEN_JWT="token_jwt" -
Load the environment variable and initialize the client:
By default, if you use OpenGateClient without parameters, and you set the environment variable TOKEN_JWT, OpenGateClient will be created with this value. If you want to use TOKEN_JWT from environment, you may delete the OPENGATE_API_KEY environment variable.
Basic use with environment variables
The most professional way to initialize the client is by using standard environment variables. If you set these, you can simply call OpenGateClient():
Basic use of token_jwt with an environment variable
To initialize the client using a token_jwt from an environment variable, you can set the token_jwt directly in your environment without relying on a .env:
-
Create environment variable
-
On UNIX systems, use:
-
On Windows, use:
-
-
Initialize the client.
Similar to the previous example, if you use OpenGateClient without parameters, and you set the environment variable TOKEN_JWT, OpenGateClient will be created with this value. If you want to use TOKEN_JWT from environment, you may delete API_KEY variable environment.
Basic use without url for services K8s
To initialize the OpenGateClient without specifying a URL, you can either omit the url parameter or set it to None.
Similar to the previous examples, you have the option to provide the api_key directly, set it to None, or omit it altogether. If you choose to omit it, the client will automatically retrieve the api_key from the environment variable if it is set. Additionally, you can also authenticate using a username and password by specifying those credentials instead.
Features
The library consists of the following modules:
- IA
- Models
- Pipelines
- Transformers
- Collection
- Collection
- Bulk Collection
- Pandas Collection
- Provision
- Asset
- Bulk
- Devices
- Processor
- Rules
- Rules
- Searching
- Alarms
- Datapoints
- Data sets
- Entities
- Operations
- Rules
- Timeseries
- File Connector
- File Connector
Basic Examples of the OpenGate-Data Modules
The unit tests double as usage examples: opengate_data/test/unit/ holds one
directory per module, each showing the configurations and use cases of its
builders.
License
This project is licensed under the Apache License 2.0.