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.

1from axiomatic import Axiomatic
2
3client = Axiomatic(
4 api_key="YOUR_API_KEY",
5)
6client.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.

1import asyncio
2
3from axiomatic import AsyncAxiomatic
4
5client = AsyncAxiomatic(
6 api_key="YOUR_API_KEY",
7)
8
9
10async def main() -> None:
11 await client.pic.extract_from_text(query="Query describing a PIC")
12
13
14asyncio.run(main())

Exception handling

1from axiomatic import Axiomatic
2from axiomatic.core.api_error import ApiError
3
4try:
5 client.pic.extract(...)
6except ApiError as e:
7 print(e.status_code)
8 print(e.body)

Cookbooks

Visit our cookbooks section to see what you can do with our API.