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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aethis_sdk-0.3.1.tar.gz
  • Upload date:
  • Size: 13.4 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.1.tar.gz
Algorithm Hash digest
SHA256 9dfc99c793850a8ab683045f9eeb89e02146a67c1236c82d4bdb175e310e2d27
MD5 88004a2617c5c621401b17b716c10444
BLAKE2b-256 f377a97ad4e177380b82c13aa9552758c719363a3f40c863cb20946f8bcad64d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: aethis_sdk-0.3.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ae1d46b7d8c4ccdeeafc310b21c934113a4e69c38692a6127ae105741e5feef
MD5 964e67d9fd3148b0ae0dc83e03572e0a
BLAKE2b-256 288abd3aa46d21d58e04b1754e0db3e57c3429c9122b99831e8604705af43aa5

See more details on using hashes here.

Provenance

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