app.anomalyarmor.ai) with the same aa_live_* Bearer tokens, so an existing Python script and a new Vercel function see identical data.
The Python SDK also ships the
anomalyarmor CLI. The TS SDK ships an npx anomalyarmor CLI. Both CLIs read ANOMALYARMOR_API_KEY from env as a convenience - library code in both SDKs requires the key to be passed explicitly.
Install side-by-side
Quickstart side-by-side
Python SDK
anomalyarmor-cli provides a Python SDK and CLI for programmatic access.
Installation
Requires Python 3.9 or higher.
Quick Start
Configuration
Environment Variables
Client Options
Resources
The client provides access to all AnomalyArmor resources:Common Patterns
Airflow Pre-flight Check
Gate your pipeline on data freshness:List and Filter Assets
Trigger and Wait for Refresh
Check Lineage Before Running
Monitor Data Quality Metrics
Exception Handling
Context Manager
The client supports context manager for automatic cleanup:Type Hints
The SDK is fully typed for IDE support:Next Steps
SDK Reference
Complete method reference
CLI Guide
Command-line interface
Airflow Integration
Use in Airflow DAGs
API Reference
REST API documentation
Common Questions
Should I use the Python SDK or the TypeScript SDK?
Pick whichever matches the runtime you’re already using: Python for Airflow, dbt hooks, and notebooks; TypeScript for Next.js, Vercel functions, and Node services. Both SDKs wrap the same REST API and accept the sameaa_live_* keys, so mixing them across services is fine. See the TypeScript SDK page for Node-specific setup.
Which Python version does the SDK require?
Python 3.9 or higher. The SDK ships fully typed models (Asset, FreshnessStatus, etc.) so you get IDE completion on every method and field. Install with pip install anomalyarmor-cli, which also installs the armor CLI.
How do I paginate through thousands of assets in Python?
Callclient.assets.list(limit=100, offset=n) in a loop, incrementing offset by the page size until an empty page comes back. The SDK mirrors the REST pagination directly rather than hiding it, which keeps memory flat for very large accounts. The pattern is shown in the “List and Filter Assets” example above.
How do I use the SDK with Airflow?
Callclient.freshness.require_fresh(asset) at the top of a task; it raises StalenessError when the asset is stale, which Airflow surfaces as a task failure. Set ARMOR_API_KEY as an Airflow connection secret and instantiate Client() with no arguments. The Airflow integration guide shows a full DAG.