omni-python-sdk
Python SDK for interacting with the Omni API
Installation
pip install -r requirements.txt
Usage
from omni_python_sdk import OmniAPI
# Set your API key and base URL
api_key = "your_api_key"
base_url = "https://your_domain.omniapp.co"
#these can optionally be set in an .env file with the following keys:
# OMNI_API_KEY=<<your api key>>
# OMNI_BASE_URL=<<your base url>>
# Define your query
query = {
"query": {
"sorts": [
{
"column_name": "order_items.created_at[date]",
"sort_descending": False
}
],
"table": "order_items",
"fields": [
"order_items.created_at[date]",
"order_items.sale_price_sum"
],
"modelId": "your_model_id",
"join_paths_from_topic_name": "order_items"
}
}
# Initialize the API with your credentials
api = OmniAPI(api_key, base_url)
# if you've optionally set your keys in a .env file no arguments are required:
# api = OmniAPI()
# if your environment variables are stored in an alternative location
# api = OmniAPI(env_file='<<path_to_custom_env>>')
# Run the query and get a table
table = api.run_query_blocking(query)
# Convert the table to a Pandas DataFrame
df = table.to_pandas()
# Display the first few rows of the DataFrame
print(df.head())
To run the example, you need to replace your_api_key, your_domain, and your_model_id with your own values.
To get a query object, you can use the Inspector on a Omni Workbook. The query object is a JSON object that represents the query you want to run. You can find the Inspector in the View menu on a Workbook. Look for the "Query Structure" section.
For a simple command line interface, you can run the following command:
python3 examples/query.py OMNI_API_KEY https://OMNI_URL '{"query": {"sorts": [{"column_name": "omni_dbt__order_items.created_at[date]", "sort_descending": false}], "table": "omni_dbt__order_items", "fields": ["omni_dbt__order_items.created_at[date]", "omni_dbt__order_items.total_sale_price"], "modelId": "OMNI_MODEL_ID", "join_paths_from_topic_name": "order_items"}}
Metadata
Release files for omni-python-sdk 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| omni_python_sdk-0.1.11.tar.gz | 15.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| omni_python_sdk-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.3 kB
Release files / omni_python_sdk-0.1.11.tar.gz
| Download URL | omni_python_sdk-0.1.11.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64a16fdcfc6aa7da4574b2e0b9a287bb81e79a1dfc6212dbba854da694887a22
|
|
BLAKE2b-256 checksum How to use checksums |
b6832067a9ee66c7190ab80da1431d05ee96eb38611d4a4b952ac4c3b0fb85cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 17, 2025.
Transparency logRelease files / omni_python_sdk-0.1.11-py3-none-any.whl
| Download URL | omni_python_sdk-0.1.11-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9514cc1a872181f0f5ce87a562238e103b8c92ee5fd12357a3cafb76cff7723c
|
|
BLAKE2b-256 checksum How to use checksums |
8de347557fe1dcfa6961dc12b2ce763383627f3ac77ac3952fb676bc63ece9b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 17, 2025.
Transparency logSecurity for omni-python-sdk 0.1.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for omni_python_sdk-0.1.11.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 17, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.