Skip to main content

Official Python SDK for the INFONITE API

Project description

Infonite Python SDK

The official Python SDK for the INFONITE API. This SDK provides simple, convenient access to the Infonite platform, including both the direct Clients API and the pre-built Widgets API.

Installation

pip install infonite

Overview

The SDK provides two primary clients depending on your integration needs:

  • InfoniteWidgetClient: For clients integrating and managing pre-built widget experiences.
  • InfoniteDirectClient: For clients building their own custom experiences over the core API.

Both clients automatically handle authentication headers (X-APP-SECRET), connection pooling, timeouts, and validation against the INFONITE servers upon initialization.

Configuration

You can seamlessly initialize the SDK by deliberately passing credentials within your source code, or implicitly via standard OS Environment Variables. Storing these credentials as system variables guarantees your secrets remain out of your remote repositories securely, without requiring heavier standard ecosystem dependencies like .env packages.

Supported Environment Variables

  • INFONITE_APP_SECRET: Your fundamental application integration secret token.
  • INFONITE_WIDGETS_API: (Optional) Absolute URL override for the Widgets API infrastructure.
  • INFONITE_CLIENTS_API: (Optional) Absolute URL override for the Custom Clients direct API.
export INFONITE_APP_SECRET="sk_prod_12345"
export INFONITE_WIDGETS_API="https://sandbox-widgets.infonite.tech"

Usage

Zero-Code Configuration

from infonite.clients import InfoniteWidgetClient

# Initializes seamlessly capturing standard OS variables from the runtime environment
client = InfoniteWidgetClient()

print(f"Verified App ID: {client.app_info.id}")

Explicit Instantiation

Widgets API Integration

from infonite.clients import InfoniteWidgetClient

client = InfoniteWidgetClient(app_secret="your_app_secret_here")

# Check your verified application state
print(f"Environment: {client.app_info.environment.value}")
print(f"Status: {client.app_info.status.value}")

# Manually refresh the application state from the server if networking fails gracefully
client.refresh_app_info()

Direct Clients API Integration

from infonite.clients import InfoniteDirectClient

# Initialize the client for custom direct experiences architectures
client = InfoniteDirectClient(app_secret="your_app_secret_here")

print(f"Running in: {client.app_info.environment}")

Features

  • Built-in Validation: Validates your secret keys synchronously during __init__ preventing late runtime execution failures.
  • Environment Native: Fully reliant on os.environ fallback logic avoiding arbitrary configuration package dependencies.
  • Type Safety: Fully typed models leveraging standard Python dataclasses alongside Enum logic (AppEnvironment, AppStatus).
  • Resiliency: Built-in HTTP transport layer (httpx) bundled with automatic timeouts mapping ensuring resilient network executions.

Development

To setup the project locally for development and testing pipelines:

# Clone the repository natively
git clone git@github.com:INFONITE-Technologies/py-infonite-sdk.git
cd py-infonite-sdk

# Create a virtual environment (optional but securely recommended)
python3 -m venv venv
source venv/bin/activate

# Install with testing distribution dependencies
pip install -e ".[test]"

# Run the test suite via the bash dev helper
./scripts/run_tests.sh

License

MIT License

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

infonite-0.0.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

infonite-0.0.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file infonite-0.0.1.tar.gz.

File metadata

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

File hashes

Hashes for infonite-0.0.1.tar.gz
Algorithm Hash digest
SHA256 14efb4e9db9f02eedd67add9cd327d25030a6f157329c5829f8710589a8d37a7
MD5 693812a163765817fc1a4cf0c94bf605
BLAKE2b-256 94d338798801ff59e0005306d786c8540d31837bb61812f5b33a1d98d85b7cdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for infonite-0.0.1.tar.gz:

Publisher: publish.yml on INFONITE-Technologies/py-infonite-sdk

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

File details

Details for the file infonite-0.0.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for infonite-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a430b2ffef01df38503e43e932404a117d48cdc3e3b38d2833204a82ed98607
MD5 667b57a9cdbc61a86390a8d9d56b8824
BLAKE2b-256 75ca73936c74f174b10fb26c3a2bbd97f3add964860e7c736e081b2d1a3d0a9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for infonite-0.0.1-py3-none-any.whl:

Publisher: publish.yml on INFONITE-Technologies/py-infonite-sdk

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