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 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

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.3.0.tar.gz (19.4 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.3.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

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

Hashes for infonite-0.3.0.tar.gz
Algorithm Hash digest
SHA256 797b7fda434a0b503ed3b7b5294896c2b67b3f53ca8a79302a5cf73c40817450
MD5 ec16a29721a119bbb0fd3945f201f729
BLAKE2b-256 b70cb75678be8dfb3ed7c4e0476abb43c45a979e4810ed94a242fe3666adceaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for infonite-0.3.0.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.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

Hashes for infonite-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 544dd6526d027b388243d00b4ffe73ca4a08ed78e57d87b3e25ed284127c7587
MD5 ce198ab83508437fa54ad9a5f8f7890e
BLAKE2b-256 a442e8a17b0f02392f76d28dfff5c797c4e5683334f77d0533ea6dec435cfcdc

See more details on using hashes here.

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

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