Guides

Python SDK

The Axiomatic Python library provides convenient access to the Axiomatic API from Python.

Installation

pip install axiomatic

Usage

Instantiate and use the client with the following:

Get your API key by following the instructions here.

from axiomatic import Axiomatic
client = Axiomatic(
api_key="YOUR_API_KEY",
)
client.pic.extract_from_text(query="Query describing a PIC")

Async client

The SDK also exports an async client so that you can make non-blocking calls to our API.

import asyncio
from axiomatic import AsyncAxiomatic
client = AsyncAxiomatic(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.pic.extract_from_text(query="Query describing a PIC")
asyncio.run(main())

Exception handling

from axiomatic import Axiomatic
from axiomatic.core.api_error import ApiError
try:
client.pic.extract(...)
except ApiError as e:
print(e.status_code)
print(e.body)