Skip to main content

Python SDK for the jpcite API (Japanese institutional data: subsidies, loans, tax rulesets, 採択事例).

Project description

autonomath (Python SDK)

Python client for the AutonoMath REST API - a catalog of Japanese institutional programs (subsidies, loans, tax incentives) with an exclusion-rule engine.

Install

pip install autonomath

(Currently unpublished; install locally with pip install -e path/to/sdk/python.)

Quick start

from autonomath import Client

c = Client(api_key="am_...")  # or leave None for anonymous free tier

meta = c.meta()
print(meta.total_programs, meta.tier_counts)

resp = c.search_programs(tier=["S", "A"], prefecture="東京都", limit=10)
for p in resp.results:
    print(p.unified_id, p.primary_name, p.tier)

detail = c.get_program(resp.results[0].unified_id)
print(detail.enriched)

check = c.check_exclusions([p.unified_id for p in resp.results])
for hit in check.hits:
    print(hit.rule_id, hit.severity, hit.programs_involved)

Async

import asyncio
from autonomath import AsyncClient

async def main():
    async with AsyncClient(api_key="am_...") as c:
        meta = await c.meta()
        print(meta.total_programs)

asyncio.run(main())

Configuration

Option Default Notes
api_key None X-API-Key header. None = anonymous/free.
base_url https://api.autonomath.ai Override for self-hosted deployments.
timeout 30.0 Per-request seconds.
max_retries 3 Applied to 429 and 5xx responses.

Retry behavior:

  • 429 Too Many Requests respects the Retry-After header (seconds).
  • 5xx retried with exponential backoff (0.5s, 1s, 2s, ...).
  • 4xx other than 429 are raised immediately.

Errors

All SDK errors inherit from autonomath.AutonoMathError:

  • AuthError (401 / 403)
  • NotFoundError (404)
  • RateLimitError (429, carries retry_after)
  • ServerError (5xx)

autonomath.JpintelError is retained as a deprecated alias for AutonoMathError. New code should import AutonoMathError.

Develop

cd sdk/python
python -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest

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

autonomath-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

autonomath-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file autonomath-0.1.0.tar.gz.

File metadata

  • Download URL: autonomath-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for autonomath-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8163f807283ac7f059d42d0ba2e2d26053560f109e5f3f54d7d2af2a0df6472e
MD5 3efdd70ce17e37075c7b866e1167ca6e
BLAKE2b-256 3c0ce5d3295802a029f63ef8a2a0428b72b89bae1361969b39294a1302fda172

See more details on using hashes here.

File details

Details for the file autonomath-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: autonomath-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for autonomath-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76ebb744425e0919b410c3566231e72a985230b6d9b3a6eb89358c61246b8a1c
MD5 8fcdfa6c2b3b38d4761042afffd822a7
BLAKE2b-256 25b556da03387503a74ec1af7913eccb2c7f9db9f3ed7deab388d620e72671fd

See more details on using hashes here.

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