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
Install from PyPI (pip, poetry add, or uv add):
pip install netrise-turbine-sdk
Create a .env file in your project directory — TurbineClientConfig.from_env() loads it automatically (current directory, then parents):
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>
Prefer plain environment variables or your own dotenv loading? Set the same names in the environment and call TurbineClientConfig.from_env(load_env_file=False).
Need credentials? Contact support@netrise.io.
Want the full experience? uv tool install netrise-turbine-cli adds the turbine CLI (SDK included), and turbine skill install adds the agent skill to Cursor, Claude Code, and Codex.
Versioning and stability
netrise_turbine_sdk(the wrapper) is semver-stable: existing imports, method names, and call signatures do not break without an intentional minor/major bump.netrise_turbine_sdk_graphql(generated) tracks the Turbine GraphQL schema. Fully typed, power-user surface; schema refreshes are guarded by API-surface snapshot tests and a schema-diff gate.
See CHANGELOG.md for release notes.
Union field aliasing
When GraphQL union members declare same-named fields with different types, the generator aliases them as {camelCaseTypeName}{PascalCaseFieldName} so each gets its own Python type. Example — both NotificationControl members define events:
for pref in client.query_notification_settings().preferences:
for control in pref.controls:
if hasattr(control, "assetAnalysisControlEvents"):
events = control.assetAnalysisControlEvents
elif hasattr(control, "userManagementControlEvents"):
events = control.userManagementControlEvents
Reducing response size (Lite / Summary)
Full query_* / iter_* methods request every field the server exposes. The trimmed counterparts typically cut response bytes 70–80%:
| Full | Lite | Summary |
|---|---|---|
iter_assets_relay |
iter_assets_relay_lite |
iter_assets_relay_summary |
iter_vulnerabilities |
iter_vulnerabilities_lite |
— |
iter_dependencies |
iter_dependencies_lite |
— |
iter_misconfigurations |
iter_misconfigurations_lite |
— |
iter_detailed_vulnerabilities |
iter_detailed_vulnerabilities_lite |
— |
query_vulnerability |
query_vulnerability_lite |
— |
Rule of thumb: Full for audit/export, Lite for tables and CSVs (identifiers, severity, CVSS/EPSS, rollup counts), Summary for org-wide sweeps (id, name, analytic counts only). Sweep with Summary, then drill in only where counts are non-zero:
from netrise_turbine_sdk import TurbineClient, TurbineClientConfig
sdk = TurbineClient(TurbineClientConfig.from_env())
for asset in sdk.iter_assets_relay_summary(page_size=100):
counts = asset.analytic
if counts.vulnerability.critical + counts.vulnerability.high > 0:
for vuln in sdk.iter_vulnerabilities_lite(asset_id=asset.id):
print(asset.name, vuln.cve, vuln.severity, vuln.cvss_score)
File listing
list_files returns the complete recursive file listing for an asset in one call:
files = sdk.list_files("your-asset-id")
for f in files:
print(f["filesystemPath"], f.get("size"), f.get("mimeType"))
Entries are dicts with keys like path, filesystemPath, size, mimeType, hashSha256, permissions, and hasChildren.
Documentation
API documentation and code samples — quick start, filtering cookbook, error handling, and per-operation pages.
License
See LICENSE.
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.18.tar.gz.
File metadata
- Download URL: netrise_turbine_sdk-0.1.18.tar.gz
- Upload date:
- Size: 116.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96c544bae5dcdeeb6e6bf138b9f23f6f79af6f8e156e1c0d4d5183bb4edf2d34
|
|
| MD5 |
4738c4dfb0b22a2e2ed020b9ae95e22b
|
|
| BLAKE2b-256 |
66b53577d3264c9b7847cf3b8546b0a77816619e0b9266a34b4c4813116c9e86
|
File details
Details for the file netrise_turbine_sdk-0.1.18-py3-none-any.whl.
File metadata
- Download URL: netrise_turbine_sdk-0.1.18-py3-none-any.whl
- Upload date:
- Size: 176.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aafd5422b0a76d9d397bd4e5ad845c915a86c369660905cda01cadba92b61270
|
|
| MD5 |
7ac9c643714ff9e163d147635c24b18f
|
|
| BLAKE2b-256 |
8af7fa4a88b0ad4fa6c7bc7d37266212143741295e0d52c73888c77aaa3d0dee
|