Skip to main content

Konnektr Graph SDK for Python

Project description

Konnektr Graph SDK for Python

A powerful, Python SDK for Konnektr Graph, fully compatible with the Azure Digital Twins API but optimized for the Konnektr ecosystem.

Features

  • Azure-Free: No dependencies on Azure libraries.
  • Synchronous & Asynchronous: High-performance clients for both threaded and async workflows.
  • Modular Auth: Supports OAuth 2.0 Client Credentials, Device Code Flow, and Static Tokens.
  • Auto-Pagination: Seamlessly iterate through large query results and resource lists.
  • Data Models: Typed dataclasses for Digital Twins, Models, Relationships, and Jobs.

Installation

pip install konnektr-graph

Quick Start

Synchronous Client

from konnektr_graph import KonnektrGraphClient
from konnektr_graph.auth import ClientSecretCredential

# Authenticate
cred = ClientSecretCredential(
    domain="auth.konnektr.io",
    audience="https://graph.konnektr.io",
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET"
)

# Initialize Client
client = KonnektrGraphClient("https://your-graph-endpoint.konnektr.io", cred)

# Get a Digital Twin
twin = client.get_digital_twin("my-twin-id")
print(twin)

# Query Twins with auto-pagination
for twin in client.query_twins("SELECT * FROM digitaltwins"):
    print(twin)

Asynchronous Client

import asyncio
from konnektr_graph.aio import KonnektrGraphClient
from konnektr_graph.auth import AsyncClientSecretCredential

async def main():
    cred = AsyncClientSecretCredential(
        domain="auth.konnektr.io",
        audience="https://graph.konnektr.io",
        client_id="...",
        client_secret="..."
    )
    
    async with KonnektrGraphClient("https://your-graph-endpoint.konnektr.io", cred) as client:
        twin = await client.get_digital_twin("my-twin-id")
        print(twin)

asyncio.run(main())

Authentication Options

  • ClientSecretCredential / AsyncClientSecretCredential: Ideal for server-to-server scenarios.
  • DeviceCodeCredential / AsyncDeviceCodeCredential: Best for interactive CLI tools.
  • StaticTokenCredential: Use when you already have a valid access token.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

konnektr_graph-0.1.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

konnektr_graph-0.1.4-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file konnektr_graph-0.1.4.tar.gz.

File metadata

  • Download URL: konnektr_graph-0.1.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for konnektr_graph-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6c512d282630d68f4374c936af1aee9e32ab3df736c669f3bc5451721adcfa25
MD5 b912068c66fe42e0ca688fd1f78907e4
BLAKE2b-256 6ba399d3981237fb3c1a3ef7904c3a2320334ae78b5d9108b85c537993240ec1

See more details on using hashes here.

Provenance

The following attestation bundles were made for konnektr_graph-0.1.4.tar.gz:

Publisher: pypi-publish.yml on konnektr-io/graph-client-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file konnektr_graph-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: konnektr_graph-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for konnektr_graph-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b911f9ca307d1e99e90c4c60912ae2a02ef40b7afd14a4be8ea4b24a9a9a9582
MD5 adfa81809a7cce55812fe54ff8358f5f
BLAKE2b-256 0f2f30c6ec9a57f6089a5e9fac54aa34362c43eb76a9c4bc84ea5af9ab0963e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for konnektr_graph-0.1.4-py3-none-any.whl:

Publisher: pypi-publish.yml on konnektr-io/graph-client-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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