Skip to main content

Omnidapter API client SDK

Project description

omnidapter-sdk

Python client for the Omnidapter API.

Omnidapter lets you connect to your users' calendars (and other services) through a single unified API. You create a link token, send the user through the Connect UI to authorise their account, and then read their data using the connection that comes back.

Installation

pip install omnidapter-sdk

Requires Python 3.10+.

Getting started

Create a client with your API key and the base URL of your Omnidapter instance:

from omnidapter_sdk import OmnidapterClient

client = OmnidapterClient(
    base_url="https://api.example.com",
    api_key="omni_live_...",
)

All methods are synchronous and return typed response objects. The actual payload is always on .data.


Providers

Providers are the services Omnidapter can connect to (e.g. Google, Microsoft). You typically list them once to populate a picker in your UI.

providers = client.providers.list_providers()
for provider in providers.data:
    print(provider.key, provider.display_name)

# Fetch a single provider by its key
google = client.providers.get_provider(provider_key="google")
print(google.data.display_name)

Connections

A connection represents an authorised link between one of your end users and a provider. Once a user completes the Connect flow, their connection appears here.

# List all connections, optionally filtering by status or provider
connections = client.connections.list_connections(status="active", provider="google")
for conn in connections.data:
    print(conn.id, conn.provider_key, conn.status)

# Fetch a single connection
conn = client.connections.get_connection(connection_id="conn_...")
print(conn.data.status)

# Revoke a connection — this also invalidates any stored credentials
client.connections.delete_connection(connection_id="conn_...")

Link tokens

A link token is a short-lived, single-use token that grants an end user access to the Connect UI. Generate one server-side, pass it to your frontend, and redirect the user to connect_url. Omnidapter will handle the OAuth flow and create a connection on success.

from omnidapter_sdk.models import CreateLinkTokenRequest

result = client.link_tokens.create_link_token(
    create_link_token_request=CreateLinkTokenRequest(
        end_user_id="user_123",           # your internal user ID
        allowed_providers=["google", "microsoft"],  # restrict which providers are shown
    )
)

token = result.data
print(token.token)       # lt_... — pass this to your frontend
print(token.connect_url) # redirect the user here to start the Connect flow
print(token.expires_at)  # datetime — tokens are short-lived, generate them on demand

Calendar

Once a user has a connection, you can read their calendar data. All calendar operations require a connection_id.

from datetime import datetime, timezone

# List the calendars available on a connection
calendars = client.calendar.list_calendars(connection_id="conn_...")
for cal in calendars.data:
    print(cal.id, cal.name)

# List events within a time range across a specific calendar
events = client.calendar.list_events(
    connection_id="conn_...",
    calendar_id="cal_...",
    start=datetime(2026, 4, 1, tzinfo=timezone.utc),
    end=datetime(2026, 4, 30, tzinfo=timezone.utc),
)
for event in events.data:
    print(event.id, event.title, event.start)

Error handling

The SDK raises ApiException for any non-2xx response. You can inspect the HTTP status code and the raw response body to handle errors appropriately.

from omnidapter_sdk.exceptions import ApiException

try:
    conn = client.connections.get_connection(connection_id="conn_unknown")
except ApiException as e:
    print(e.status)  # e.g. 404
    print(e.body)    # JSON error body from the server

Notes

  • The SDK is generated from the server's OpenAPI spec via scripts/generate_sdks.sh. Run that script after pulling changes to regenerate the client code.

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

omnidapter_sdk-0.3.3.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

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

omnidapter_sdk-0.3.3-py3-none-any.whl (116.5 kB view details)

Uploaded Python 3

File details

Details for the file omnidapter_sdk-0.3.3.tar.gz.

File metadata

  • Download URL: omnidapter_sdk-0.3.3.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for omnidapter_sdk-0.3.3.tar.gz
Algorithm Hash digest
SHA256 e9f46090897b8231851bcad57a70f16e4edbad638e35b6d99cfc3509e5a71697
MD5 2fe4843886ce0760b51132092cf8e3b0
BLAKE2b-256 185c200c61dd4927444b2d44d398851a27aaa7c26674c1b262ce17bc5fdbd11e

See more details on using hashes here.

File details

Details for the file omnidapter_sdk-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: omnidapter_sdk-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 116.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for omnidapter_sdk-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 277e9b85130412ac97a876d4bc7a84c28ac735f6477eb021ee77feb41fad3e46
MD5 cadf972c79228689c0f938c9b9c44e4a
BLAKE2b-256 b709228bf6a280e79bdeb16abc6ceccd443348415540167632d8f0c4336dbf24

See more details on using hashes here.

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