Skip to main content

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

Project description

Aethis SDK for Python

PyPI Python License: MIT

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aethis_sdk-0.3.2.tar.gz
  • Upload date:
  • Size: 14.2 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.2.tar.gz
Algorithm Hash digest
SHA256 f7cbbcaba28c199c5c8f35c3ddfbc8e5e89a3b2adb87a827cf42e802acb10b4c
MD5 cc413b26a8776221f24bdc9a21cb410e
BLAKE2b-256 13827a646eea767c7c6154b82a6fdfb024b04be801ba6b54282b18283a18b395

See more details on using hashes here.

Provenance

The following attestation bundles were made for aethis_sdk-0.3.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: aethis_sdk-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 10.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 580d604f0b72ff1eab8ddb070d948d1019df2ce4dae2f6d66b59cfd2d065a7f8
MD5 40ca814824590e36ce7889d15d2eef4f
BLAKE2b-256 ad7b6ffeb73371e659ff99ba792cd527bf81ed855f7351931075477d1ffb6f3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aethis_sdk-0.3.2-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