AnomalyArmor SDK and CLI for data observability
Reason this release was yanked:
Package renamed to anomalyarmor-cli
Project description
armor
Official Python SDK and CLI for AnomalyArmor - Data Observability Platform.
Installation
pip install armor
Quick Start
from armor import Client
# Initialize client (uses ARMOR_API_KEY env var)
client = Client()
# Check if data is fresh - raises StalenessError if stale
client.freshness.require_fresh("snowflake.prod.warehouse.orders")
print("Data is fresh, proceeding with pipeline...")
Key Features
Gate Pattern for Pipelines
The require_fresh() method fails fast if data is stale:
from armor import Client
from armor.exceptions import StalenessError
client = Client()
try:
client.freshness.require_fresh("snowflake.prod.warehouse.orders")
# Data is fresh, safe to proceed
run_transformation()
except StalenessError as e:
# Data is stale, handle appropriately
print(f"Stale: {e.asset} - last updated {e.last_updated}")
# Fail the pipeline, send alert, etc.
CLI for CI/CD
# Check freshness (exit 0=fresh, 1=stale)
armor freshness check snowflake.prod.warehouse.orders
# Use in CI/CD
armor freshness check snowflake.prod.warehouse.orders || exit 1
Comprehensive Monitoring
from armor import Client
client = Client()
# List assets
for asset in client.assets.list(source="snowflake"):
print(f"{asset.qualified_name}: {asset.asset_type}")
# Check freshness status
status = client.freshness.get("snowflake.prod.warehouse.orders")
print(f"Fresh: {status.is_fresh}, Last updated: {status.last_updated}")
# Get lineage
lineage = client.lineage.get("snowflake.prod.warehouse.orders")
for upstream in lineage.upstream:
print(f"Depends on: {upstream.qualified_name}")
# View alerts
alerts = client.alerts.list(status="triggered")
for alert in alerts:
print(f"{alert.qualified_name}: {alert.message}")
Configuration
Configuration can be set via:
-
Environment variables (highest priority)
ARMOR_API_KEY: Your API keyARMOR_API_URL: API base URL
-
Config file (
~/.armor/config.yaml)api_key: aa_live_...
-
Parameters when initializing the client
client = Client(api_key="aa_live_...")
CLI Commands
Authentication
armor auth login # Authenticate with API key
armor auth status # Check authentication status
armor auth logout # Remove stored credentials
Assets
armor assets list # List all assets
armor assets list --source postgresql # Filter by source
armor assets get <qualified_name> # Get asset details
Freshness
armor freshness summary # Get freshness summary
armor freshness get <asset> # Check asset freshness
armor freshness list --status stale # List stale assets
Schema
armor schema summary # Get changes summary
armor schema changes # List all changes
armor schema changes --unacknowledged # Only unacknowledged
Alerts
armor alerts summary # Get alerts summary
armor alerts list # List all alerts
armor alerts list --severity critical # Filter by severity
API Keys
armor api-keys list # List API keys
armor api-keys create --name "CI/CD" # Create new key
armor api-keys revoke <key_id> # Revoke a key
Lineage
armor lineage get <asset> # Get asset lineage
armor lineage get <asset> --depth 2 # With depth
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Asset is stale (freshness check) |
| 2 | Authentication error |
| 3 | Resource not found |
| 4 | Rate limit exceeded |
| 5 | General error |
Examples
CI/CD Pipeline Integration
# .github/workflows/data-quality.yml
- name: Check data freshness
run: |
pip install armor-cli
armor freshness get production.analytics.orders
env:
ARMOR_API_KEY: ${{ secrets.ARMOR_API_KEY }}
Airflow Operator
from airflow.operators.python import PythonOperator
from armor import Client
def check_upstream_freshness(asset_name: str):
client = Client()
status = client.freshness.get(asset_name)
if status.is_stale:
raise Exception(f"Upstream {asset_name} is stale")
check_freshness = PythonOperator(
task_id="check_freshness",
python_callable=check_upstream_freshness,
op_kwargs={"asset_name": "production.raw.events"},
)
Development
# Clone the repo
git clone https://github.com/anomalyarmor/armor-cli
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
ruff check .
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file armor_cli-0.1.0.tar.gz.
File metadata
- Download URL: armor_cli-0.1.0.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4f2b46ee14a0baa7d0cf3b613cce9cbe59c69339147ab5129af972d13fbdcbd
|
|
| MD5 |
8fcadc0d15fa43918767200768ca79ce
|
|
| BLAKE2b-256 |
06e086dc2db1b8e3c4c199400111910dc804cc627b97c73b51e50909e5df7a34
|
Provenance
The following attestation bundles were made for armor_cli-0.1.0.tar.gz:
Publisher:
publish-sdk.yml on anomalyarmor/core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
armor_cli-0.1.0.tar.gz -
Subject digest:
b4f2b46ee14a0baa7d0cf3b613cce9cbe59c69339147ab5129af972d13fbdcbd - Sigstore transparency entry: 742607315
- Sigstore integration time:
-
Permalink:
anomalyarmor/core@3978d0cc1e6bec50ca77b05a78b81732967dac39 -
Branch / Tag:
refs/tags/sdk-v0.1.0 - Owner: https://github.com/anomalyarmor
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@3978d0cc1e6bec50ca77b05a78b81732967dac39 -
Trigger Event:
release
-
Statement type:
File details
Details for the file armor_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: armor_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
311b5d0face756613b2216dc42c8d60c2180e1ed1be9d1b5c6e3b5a6f780750f
|
|
| MD5 |
7adf0782db85a76e392134cd24512dbd
|
|
| BLAKE2b-256 |
7563eddd9ead1e35831389545dc1258680984b1508c1c934738e6efe7e5c4bf4
|
Provenance
The following attestation bundles were made for armor_cli-0.1.0-py3-none-any.whl:
Publisher:
publish-sdk.yml on anomalyarmor/core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
armor_cli-0.1.0-py3-none-any.whl -
Subject digest:
311b5d0face756613b2216dc42c8d60c2180e1ed1be9d1b5c6e3b5a6f780750f - Sigstore transparency entry: 742607317
- Sigstore integration time:
-
Permalink:
anomalyarmor/core@3978d0cc1e6bec50ca77b05a78b81732967dac39 -
Branch / Tag:
refs/tags/sdk-v0.1.0 - Owner: https://github.com/anomalyarmor
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@3978d0cc1e6bec50ca77b05a78b81732967dac39 -
Trigger Event:
release
-
Statement type: