Registry / observability / axiom-py

axiom-py

JSON →
library0.12.0pypypi✓ verified 23d ago

axiom-py is the official Python SDK for interacting with the Axiom API, allowing users to ingest, query, and manage observability data at scale. It provides both synchronous and asynchronous clients. The current version is 0.10.0 and it maintains an active release cadence with ongoing development.

pip install axiom-py
INSTALL
IMPORT
SIG · AXIOM-PY
A
axiom-py
observabilitypythonv0.12.0
Install
2.9s avg
Import
680ms
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.12.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.706s · 29.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.9s · import 0.654s · 26MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
from axiom_py import Client
AsyncClient
from axiom_py import AsyncClient
AxiomHandler
from axiom_py.logging import AxiomHandler
AxiomProcessor
from axiom_py.structlog import AxiomProcessor

This quickstart demonstrates how to initialize the Axiom client using environment variables for security, ingest sample events, and then query them. It uses the asynchronous client for better performance.

import os from axiom_py import Client import asyncio AXIOM_TOKEN = os.environ.get('AXIOM_TOKEN', 'YOUR_AXIOM_TOKEN') AXIOM_ORG_ID = os.environ.get('AXIOM_ORG_ID', 'YOUR_AXIOM_ORG_ID') DATASET_NAME = os.environ.get('AXIOM_DATASET', 'your-dataset-name') async def main(): if not AXIOM_TOKEN or not AXIOM_ORG_ID or not DATASET_NAME: print("Please set AXIOM_TOKEN, AXIOM_ORG_ID, and AXIOM_DATASET environment variables or replace placeholders.") return client = Client(token=AXIOM_TOKEN, org_id=AXIOM_ORG_ID) # Ingest events try: response = client.ingest_events( dataset=DATASET_NAME, events=[ {"service": "my-app", "level": "info", "message": "User logged in"}, {"service": "my-app", "level": "debug", "message": "Processing data"} ] ) print(f"Ingest response: {response}") except Exception as e: print(f"Error during ingest: {e}") # Query data try: query_result = client.query(f"['{DATASET_NAME}'] | limit 2") print(f"Query result matches: {len(query_result.matches)}") for match in query_result.matches: print(match.data) except Exception as e: print(f"Error during query: {e}") if __name__ == "__main__": asyncio.run(main())
Debug
Known issues
breakingVersion v0.9.0 removed the 'aggregation operation enum'. If you were using this enum for defining aggregation operations, your code will break.
fix
Review your aggregation queries and update them to use the new method for specifying aggregation operations, likely string-based or a different object structure. Refer to the official documentation for updated aggregation syntax.
affects: >=0.9.0
gotchaWhen using edge endpoints for ingestion and query operations, you must use API tokens (prefixed with `xaat-`) and pass the edge configuration explicitly to the client constructor. Personal tokens are not supported for edge endpoints.
fix
Ensure you generate and use an API token (xaat- prefixed) for edge ingestion and explicitly set the `edge` or `edge_url` parameter when initializing the `Client` or `AsyncClient`.
affects: All versions
gotchaAxiom client initialization requires an API token and optionally an organization ID. These can be passed directly to the constructor or set via `AXIOM_TOKEN` and `AXIOM_ORG_ID` environment variables. Failing to provide these will result in authentication errors.
fix
Set the `AXIOM_TOKEN` and `AXIOM_ORG_ID` environment variables, or pass `token` and `org_id` arguments explicitly to the `axiom_py.Client()` or `axiom_py.AsyncClient()` constructor. For example: `client = axiom_py.Client(token='YOUR_TOKEN', org_id='YOUR_ORG_ID')`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'axiom'
The 'axiom-py' package is not installed in the Python environment.
fix
Install the package using pip: 'pip install axiom-py'.
ImportError: cannot import name 'Client' from 'axiom'
Attempting to import 'Client' from 'axiom' instead of 'axiom_py'.
fix
Use the correct import statement: 'from axiom_py import Client'.
AttributeError: module 'axiom_py' has no attribute 'Client'
The 'axiom-py' package is not installed or is outdated.
fix
Ensure the package is installed and up-to-date: 'pip install --upgrade axiom-py'.
TypeError: 'NoneType' object is not callable
The 'Client' object was not properly initialized, possibly due to missing or incorrect API credentials.
fix
Initialize the 'Client' with valid API credentials: 'client = Client("<api token>", "<org id>")'.
ValueError: Invalid dataset name
The specified dataset name does not exist or is misspelled.
fix
Verify the dataset name and ensure it exists in your Axiom account.
Upgrade
Version history
0.12.0latest on PyPI · released May 18, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
axiom-py — pip install axiom-py · libregistry