Skip to main content

Official Python SDK for the Aethis developer API — eligibility decisions and bundle schemas

Project description

Aethis SDK for Python

Official Python SDK for the Aethis developer API — eligibility decisions, ruleset schemas, and stateful decision sessions.

Documentation: docs.aethis.ai · OpenAPI spec · agents via MCP: claude mcp add aethis -- npx -y aethis-mcp

Install

pip install aethis-sdk

Python 3.11+. Requires httpx and pydantic.

Quickstart

One-shot decision (sync)

from aethis_sdk import Aethis

with Aethis(api_key="YOUR_KEY") as client:
    response = client.decide(
        ruleset_id="eng_lang:20250912-ec5d7c23",
        field_values={
            "nationality": "French",
            "degree_awarded_in_uk": True,
        },
    )
    print(response.decision)  # "eligible" | "not_eligible" | "undetermined"

One-shot decision (async)

import asyncio
from aethis_sdk import AsyncAethis

async def main():
    async with AsyncAethis(api_key="YOUR_KEY") as client:
        response = await client.decide(
            ruleset_id="eng_lang:20250912-ec5d7c23",
            field_values={"nationality": "French"},
        )
        print(response.decision)

asyncio.run(main())

Stateful decision session

Accumulate answers locally and query the API only when needed. Cached until an answer changes. The session does not manage the client — the caller keeps the Aethis context open for the session's lifetime.

from aethis_sdk import Aethis, SyncDecisionSession

with Aethis(api_key="YOUR_KEY") as client:
    schema = client.get_schema("eng_lang:20250912-ec5d7c23")
    session = SyncDecisionSession("eng_lang:20250912-ec5d7c23", client, schema)
    session.answer("nationality", "French")
    while (nq := session.next_question()) is not None:
        answer = input(f"{nq.question} ")
        session.answer(nq.field_id, answer)
    print("Eligible:", session.is_eligible())

The async equivalent is DecisionSession — same surface, await on the HTTP methods (decide, is_eligible, next_question, status).

What's included

Import Purpose
Aethis, AsyncAethis HTTP clients for /decide, /rulesets/{id}/schema, /me, /rulesets/{id}/explain, /rulesets/{id}/source
SyncDecisionSession, DecisionSession Stateful adapters over the stateless /decide endpoint
DecideResponse, SchemaResponse, SchemaField, NextQuestion, SectionResult Pydantic response models
AethisError, AethisAPIError, AethisUnavailable, AethisTimeout Exception hierarchy

Configuration

  • api_key — required. Provisioned via aethis.ai.
  • base_url — defaults to https://api.aethis.ai. HTTP is only permitted for localhost / 127.0.0.1 or when passing a test transport.
  • timeout — per-request, seconds. Defaults to 5.
  • iam_token — optional bearer token for Cloud Run service-to-service auth.

Status

Pre-1.0. The decision surface (/decide, /schema) is stable; authoring endpoints (projects, rulesets, publishing) are not yet exposed here — use the Aethis CLI for those.

Links

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

aethis_sdk-0.3.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

aethis_sdk-0.3.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file aethis_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: aethis_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aethis_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c48612268ee9aff14e258018c7b1cd1fe0560d08e9ae0bbfc6238e3c23251f79
MD5 d16b2fedb74f8bfe4f087859c2419787
BLAKE2b-256 c32e4fd8f9fa4de8c88983f942c07852536b54aa867a797252898343805967a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for aethis_sdk-0.3.0.tar.gz:

Publisher: publish.yml on Aethis-ai/aethis-sdk-python

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

File details

Details for the file aethis_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: aethis_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aethis_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc3732f6679e13edd5075629ac64a41aa4b86369a88ef8380cac065497804156
MD5 44bd2581d9390489d0b750d3a70fb411
BLAKE2b-256 72d3f063057aea3a558eacca18e04a5101adf4b2952b89c431b18cb08fdd5418

See more details on using hashes here.

Provenance

The following attestation bundles were made for aethis_sdk-0.3.0-py3-none-any.whl:

Publisher: publish.yml on Aethis-ai/aethis-sdk-python

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