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 asynchronous access to the Infonite platform, including both the core internal Clients API and the pre-built Widgets API.
Installation
pip install infonite
Overview
The SDK relies entirely on modern Python standard asynchronous patterns (asyncio) ensuring zero-blocking event loop integrations out-of-the-box for highly concurrent backend systems:
InfoniteWidgetClient: For backend pipelines integrating and securely configuring remote Widget configurations.InfoniteDirectClient: For architects building raw standalone abstractions directly addressing Infonite APIs.
Configuration
You can seamlessly initialize the SDK by deliberately passing credentials within your source code, or implicitly via standard OS Environment Variables. The SDK natively incorporates python-dotenv, meaning it will automatically detect and securely load any .env file present at the root of your application execution context.
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.INFONITE_LOG_LEVEL: (Optional) Defines standard Python SDK logging levels (e.g.,DEBUG,INFO). Extremely useful for debugging active application connections securely evaluating contextual TCP pools.
export INFONITE_APP_SECRET="sk_prod_12345"
export INFONITE_WIDGETS_API="https://sandbox-widgets.infonite.tech"
Usage
Zero-Code Configuration
import asyncio
from infonite.clients import InfoniteWidgetClient
# Execute natively leveraging local contexts inside Python operational scopes
async def main():
async with InfoniteWidgetClient() as client:
print(f"Verified App ID: {client.app_info.id}")
asyncio.run(main())
Explicit Instantiation
Widgets API Integration
import asyncio
from infonite.clients import InfoniteWidgetClient
async def evaluate_environment():
async with InfoniteWidgetClient(app_secret="your_app_secret_here") as client:
# Check your internally authorized operational state securely
print(f"Environment: {client.app_info.environment.value}")
print(f"Status: {client.app_info.status.value}")
# Manually invoke connection validations updating active configurations
await client.refresh_app_info()
asyncio.run(evaluate_environment())
Direct Clients API Integration (Explicit Connect)
import asyncio
from infonite.clients import InfoniteDirectClient
async def custom_worker():
# Execute native independent TCP configurations for restrictive orchestrators
client = InfoniteDirectClient(app_secret="your_app_secret_here")
await client.connect()
print(f"Execution Target: {client.app_info.environment.value}")
# Properly finalize underlying TCP mappings guaranteeing memory hygiene natively
await client.close()
asyncio.run(custom_worker())
Features
- Built-in Validation: Validates your secret keys asynchronously fetching data proactively protecting downstream pipelines safely.
- Environment Native: Fully reliant on elegant
.envparsing mapping directly intoos.environfallback logic securely. - Async Exclusive: Implemented radically adopting asynchronous Python 3 patterns
httpx.AsyncClientmaximizing parallel executions. - Context Handling: Adopts exclusively context managers ensuring unmapped TCP socket leakage is structurally avoided.
Development
# Clone the repository natively
git clone git@github.com:INFONITE-Technologies/py-infonite-sdk.git
cd py-infonite-sdk
# Create a securely localized virtual environment
python3 -m venv venv
source venv/bin/activate
# Install with testing distribution dependencies ensuring tests pass
pip install -e ".[test]"
# Run the localized async evaluation bash logic suite
./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.3.0.tar.gz.
File metadata
- Download URL: infonite-0.3.0.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
797b7fda434a0b503ed3b7b5294896c2b67b3f53ca8a79302a5cf73c40817450
|
|
| MD5 |
ec16a29721a119bbb0fd3945f201f729
|
|
| BLAKE2b-256 |
b70cb75678be8dfb3ed7c4e0476abb43c45a979e4810ed94a242fe3666adceaa
|
Provenance
The following attestation bundles were made for infonite-0.3.0.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.3.0.tar.gz -
Subject digest:
797b7fda434a0b503ed3b7b5294896c2b67b3f53ca8a79302a5cf73c40817450 - Sigstore transparency entry: 1191992676
- Sigstore integration time:
-
Permalink:
INFONITE-Technologies/py-infonite-sdk@cb343e2eb4c9b5293804659679bfe292fa9d6117 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/INFONITE-Technologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb343e2eb4c9b5293804659679bfe292fa9d6117 -
Trigger Event:
release
-
Statement type:
File details
Details for the file infonite-0.3.0-py3-none-any.whl.
File metadata
- Download URL: infonite-0.3.0-py3-none-any.whl
- Upload date:
- Size: 19.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 |
544dd6526d027b388243d00b4ffe73ca4a08ed78e57d87b3e25ed284127c7587
|
|
| MD5 |
ce198ab83508437fa54ad9a5f8f7890e
|
|
| BLAKE2b-256 |
a442e8a17b0f02392f76d28dfff5c797c4e5683334f77d0533ea6dec435cfcdc
|
Provenance
The following attestation bundles were made for infonite-0.3.0-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.3.0-py3-none-any.whl -
Subject digest:
544dd6526d027b388243d00b4ffe73ca4a08ed78e57d87b3e25ed284127c7587 - Sigstore transparency entry: 1191992678
- Sigstore integration time:
-
Permalink:
INFONITE-Technologies/py-infonite-sdk@cb343e2eb4c9b5293804659679bfe292fa9d6117 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/INFONITE-Technologies
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cb343e2eb4c9b5293804659679bfe292fa9d6117 -
Trigger Event:
release
-
Statement type: