Turbine GraphQL Python SDK (generated via ariadne-codegen)
Project description
Turbine Python SDK
Minimal, sync-first Python client for the Turbine GraphQL API.
Getting Started
Installation from PyPI
Install from PyPI as netrise-turbine-sdk:
# pip
pip install netrise-turbine-sdk
# poetry
poetry add netrise-turbine-sdk
# uv
uv add netrise-turbine-sdk
Configure environment variables
The SDK automatically loads environment variables from a .env file in your current working directory when you call TurbineClientConfig.from_env(). You can also set environment variables directly.
Option 1: Using a .env file (recommended)
Create a .env file in your project directory:
endpoint=https://apollo.turbine.netrise.io/graphql/v3
audience=https://prod.turbine.netrise.io/
domain=https://authn.turbine.netrise.io
client_id=<client_id>
client_secret=<client_secret>
organization_id=<org_id>
The SDK will automatically load these when you call TurbineClientConfig.from_env(). The .env file is searched in:
- Current working directory (most common)
- Parent directories (walks up the directory tree)
Option 2: Set environment variables directly
import os
os.environ["endpoint"] = "https://apollo.turbine.netrise.io/graphql/v3"
# ... set other variables
cfg = TurbineClientConfig.from_env(load_env_file=False)
Option 3: Disable automatic .env loading
If you prefer to load .env files manually:
from dotenv import load_dotenv
load_dotenv() # Your custom loading logic
cfg = TurbineClientConfig.from_env(load_env_file=False)
Populate the missing values. Reach out to mailto:support@netrise.io if you need assistance.
Union Field Aliasing Convention
When GraphQL union types have members with identically-named fields that return different types, the SDK automatically applies aliases to disambiguate them. This is necessary because code generators cannot create a single Python type for fields with conflicting return types.
Naming Convention
Aliased fields follow the pattern: {camelCaseTypeName}{PascalCaseFieldName}
For example, the NotificationControl union has AssetAnalysisControl and UserManagementControl types that both define an events field with different return types. In the generated SDK, these become:
AssetAnalysisControl.events→assetAnalysisControlEventsUserManagementControl.events→userManagementControlEvents
Example Usage
# Accessing aliased fields on union type members
notification_settings = client.query_notification_settings()
for pref in notification_settings.preferences:
for control in pref.controls:
# Access the aliased field based on the control type
if hasattr(control, 'assetAnalysisControlEvents'):
events = control.assetAnalysisControlEvents
elif hasattr(control, 'userManagementControlEvents'):
events = control.userManagementControlEvents
This aliasing is applied automatically during SDK generation and only affects fields that would otherwise cause type conflicts.
License
See LICENSE for details.
Documentation
- API Documentation & Code Samples - detailed examples for all client SDK operations.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netrise_turbine_sdk-0.1.12.tar.gz.
File metadata
- Download URL: netrise_turbine_sdk-0.1.12.tar.gz
- Upload date:
- Size: 84.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d705fb311eb12edabedd51bdb20f6ddb2284036097de196390a7a7e2ba2395e
|
|
| MD5 |
610ecace76bfb8a9a9b734a952130ca8
|
|
| BLAKE2b-256 |
adb3dc5c8396d828b569a09cdf0d1e5cd2e9d2e6768b07ac75952db5af2bd88d
|
File details
Details for the file netrise_turbine_sdk-0.1.12-py3-none-any.whl.
File metadata
- Download URL: netrise_turbine_sdk-0.1.12-py3-none-any.whl
- Upload date:
- Size: 133.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e45fe3d42b9c16e55c126f6f8ea1ed09c5f61e31e1f38f867a9058ed8e00b94b
|
|
| MD5 |
2a629f97773f4a24a4ff1ef6b3765308
|
|
| BLAKE2b-256 |
ffd46ff8ec3c9642d4a8e84841068f9f3a6d5cb34385b7e512ed3b28af872e4e
|