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.environfallback logic avoiding arbitrary configuration package dependencies. - Type Safety: Fully typed models leveraging standard Python
dataclassesalongsideEnumlogic (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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14efb4e9db9f02eedd67add9cd327d25030a6f157329c5829f8710589a8d37a7
|
|
| MD5 |
693812a163765817fc1a4cf0c94bf605
|
|
| BLAKE2b-256 |
94d338798801ff59e0005306d786c8540d31837bb61812f5b33a1d98d85b7cdf
|
Provenance
The following attestation bundles were made for infonite-0.0.1.tar.gz:
Publisher:
publish.yml on INFONITE-Technologies/py-infonite-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infonite-0.0.1.tar.gz -
Subject digest:
14efb4e9db9f02eedd67add9cd327d25030a6f157329c5829f8710589a8d37a7 - Sigstore transparency entry: 1191883762
- Sigstore integration time:
-
Permalink:
INFONITE-Technologies/py-infonite-sdk@10c2e25119abaa055eeb561689418d709805b513 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/INFONITE-Technologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@10c2e25119abaa055eeb561689418d709805b513 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a430b2ffef01df38503e43e932404a117d48cdc3e3b38d2833204a82ed98607
|
|
| MD5 |
667b57a9cdbc61a86390a8d9d56b8824
|
|
| BLAKE2b-256 |
75ca73936c74f174b10fb26c3a2bbd97f3add964860e7c736e081b2d1a3d0a9b
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infonite-0.0.1-py3-none-any.whl -
Subject digest:
8a430b2ffef01df38503e43e932404a117d48cdc3e3b38d2833204a82ed98607 - Sigstore transparency entry: 1191883771
- Sigstore integration time:
-
Permalink:
INFONITE-Technologies/py-infonite-sdk@10c2e25119abaa055eeb561689418d709805b513 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/INFONITE-Technologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@10c2e25119abaa055eeb561689418d709805b513 -
Trigger Event:
release
-
Statement type: