Skip to main content

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 .env parsing mapping directly into os.environ fallback logic securely.
  • Async Exclusive: Implemented radically adopting asynchronous Python 3 patterns httpx.AsyncClient maximizing 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

Metadata

Release files for infonite 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for infonite 0.3.0
File Size Uploaded
infonite-0.3.0.tar.gz 19.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for infonite 0.3.0
File Interpreter ABI Platform
infonite-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / infonite-0.3.0.tar.gz

Download URL infonite-0.3.0.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
797b7fda434a0b503ed3b7b5294896c2b67b3f53ca8a79302a5cf73c40817450
BLAKE2b-256 checksum
How to use checksums
b70cb75678be8dfb3ed7c4e0476abb43c45a979e4810ed94a242fe3666adceaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.

Transparency log

Release files / infonite-0.3.0-py3-none-any.whl

Download URL infonite-0.3.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
544dd6526d027b388243d00b4ffe73ca4a08ed78e57d87b3e25ed284127c7587
BLAKE2b-256 checksum
How to use checksums
a442e8a17b0f02392f76d28dfff5c797c4e5683334f77d0533ea6dec435cfcdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page