prizm-airflow
Prizm Airflow metadata extraction CLI for reading Airflow REST API metadata, packaging it into a JSON bundle, and pushing it to Prizm.
Location: prizm-cli/prizm-airflow-cli (under Server root)
Key Design Principles:
- ✅ Does NOT execute Airflow DAGs or tasks
- ✅ Does NOT process metadata locally — reads Airflow's REST API and forwards the bundle as-is
- ✅ Safe to use in CI/CD, cron, Airflow itself, GitHub Actions, Jenkins, etc.
- ✅ Explicit flags, no magic, deterministic behavior
Prizm stages the uploaded bundle and runs TECHNICAL followed by OPERATIONAL processing server-side.
Installation
From PyPI
pip install prizm-airflow-cli
From Wheel File
pip install dist/prizm_airflow_cli-*.whl
The wheel is self-contained; only requests is required at runtime.
From Source (Development)
pip install -e .
For development, you can install the package in editable mode. See the Development section for more details.
Quick Start
1. Set Environment Variables (Optional)
You can pass credentials as flags, or export them and reference via your shell:
export PRIZM_API_TOKEN=prizm_xxx
2. Extract and Push Airflow Metadata to Prizm
prizm-airflow extract \
--prizm-url https://<prizm-host> \
--api-token "$PRIZM_API_TOKEN" \
--connection-name "airflow_cli" \
--hostname http://localhost:8080 \
--username admin \
--password admin \
--runs 10 \
--extract-source-code true
Commands
prizm-airflow extract
Read DAGs, runs, tasks, and task instances from the Airflow REST API, build a JSON bundle, and upload it to Prizm.
Required Flags:
--prizm-url: Prizm base URL--connection-name: Prizm connection/source name (must match an existing Source in Prizm)
Authentication Flags (one of):
--api-token: Prizm API access token--client-secret: Alias for--api-token
Airflow Connection Flags:
--hostname: Airflow base URL (default:http://localhost:8080)--username/--password: Airflow basic-auth credentials--basic-auth: Base64-encodedusername:password, alternative to--username/--password
Optional Flags:
--endpoint-url: Full ingest URL; overrides--prizm-url+ default path--runs: Number of recent DAG runs to fetch per DAG (default: 30)--extract-source-code: Fetch DAG file source (default: true)--include-full-log: Fetch and include the full task log for failed task instances (default: false)--dry-run: Build the bundle and write it to--outlocally without uploading--out: Output path for--dry-run(default:airflow_bundle.json)
Example:
prizm-airflow extract \
--prizm-url https://api.prizm.ai \
--api-token "$PRIZM_API_TOKEN" \
--connection-name "My Airflow Source" \
--hostname https://airflow.internal.example.com \
--basic-auth "$AIRFLOW_BASIC_AUTH_B64" \
--runs 50 \
--extract-source-code true \
--include-full-log false
Bundle Contents:
- DAGs (id, metadata)
- DAG runs (up to
--runsmost recent per DAG) - Tasks per DAG
- Task instances per DAG run
- DAG source code (when
--extract-source-code true) - Full failed-task logs (when
--include-full-log true)
Dry run (--dry-run): builds the bundle and writes it to --out instead of uploading — useful for inspecting bundle contents or debugging Airflow connectivity before sending anything to Prizm.
prizm-airflow extract \
--prizm-url https://api.prizm.ai \
--connection-name "My Airflow Source" \
--hostname http://localhost:8080 \
--username admin \
--password admin \
--dry-run \
--out /tmp/airflow_bundle.json
The CLI authenticates to Prizm's ingest endpoint with Authorization: Bearer <token> and uploads the bundle as a multipart file (airflow_bundle.json) alongside the connection_name field.
CI/CD Integration
GitHub Actions
- name: Push Airflow metadata to Prizm
env:
PRIZM_API_TOKEN: ${{ secrets.PRIZM_API_TOKEN }}
run: |
prizm-airflow extract \
--prizm-url https://api.prizm.ai \
--api-token "$PRIZM_API_TOKEN" \
--connection-name "My Airflow Source" \
--hostname https://airflow.internal.example.com \
--basic-auth "${{ secrets.AIRFLOW_BASIC_AUTH_B64 }}" \
--runs 30
Airflow (self-monitoring)
from airflow.operators.bash import BashOperator
push_prizm_metadata = BashOperator(
task_id="push_prizm_airflow_metadata",
bash_command="""
prizm-airflow extract \
--prizm-url https://api.prizm.ai \
--connection-name "My Airflow Source" \
--hostname http://localhost:8080 \
--username "{{ var.value.AIRFLOW_ADMIN_USER }}" \
--password "{{ var.value.AIRFLOW_ADMIN_PASSWORD }}" \
--runs 30
""",
env={
"PRIZM_API_TOKEN": "{{ var.value.PRIZM_API_TOKEN }}",
},
)
Jenkins
stage('Push Airflow metadata to Prizm') {
steps {
sh '''
prizm-airflow extract \
--prizm-url https://api.prizm.ai \
--api-token "${PRIZM_API_TOKEN}" \
--connection-name "My Airflow Source" \
--hostname https://airflow.internal.example.com \
--basic-auth "${AIRFLOW_BASIC_AUTH_B64}" \
--runs 30
'''
}
}
Development
Development Setup
pip install -e ".[dev,test]"
Running Tests
make test
Build Wheel
make build
For offline/local environments where build dependencies are already installed:
make build-local
This outputs a wheel and sdist to dist/.
Clean Build Artifacts
make clean
This removes build/ and dist/ directories, egg-info, and Python cache files.
Publish
Build both source and wheel distributions:
python -m build --sdist --wheel
Upload to TestPyPI first:
python -m twine upload --repository testpypi dist/*
Upload to PyPI:
python -m twine upload dist/*
Security
- Token-based authentication via
--api-token/--client-secretor environment variable - Tokens never logged or printed
- TLS enforced for all API calls
- No secrets written to the dry-run output bundle
License
MIT License
Support
For issues and questions, please visit: https://github.com/DQLabs-Inc/prizm-cli/issues
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 prizm_airflow_cli-0.1.1.tar.gz.
File metadata
- Download URL: prizm_airflow_cli-0.1.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
256cfdab83a480c8c564d3066d2d5c5b61d34af4600fd4e11df7569a4edc0ddc
|
|
| MD5 |
30236c4090213a648e573e7ba7a14bab
|
|
| BLAKE2b-256 |
65884fea5df1773aba95ff9a63bfc65568770fcb1eb0fd017e28d2eb529bd0a4
|
Provenance
The following attestation bundles were made for prizm_airflow_cli-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on DQLabs-Inc/prizm-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prizm_airflow_cli-0.1.1.tar.gz -
Subject digest:
256cfdab83a480c8c564d3066d2d5c5b61d34af4600fd4e11df7569a4edc0ddc - Sigstore transparency entry: 2501336276
- Sigstore integration time:
-
Permalink:
DQLabs-Inc/prizm-cli@279fd5c3802afaba442a91db8cccd40ac3a45c65 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DQLabs-Inc
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@279fd5c3802afaba442a91db8cccd40ac3a45c65 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file prizm_airflow_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: prizm_airflow_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0742124b701978aef400d9a34ba5494d3a319717d1cbba2e9667095a031961c6
|
|
| MD5 |
7fd0213c945268387ceec9ac0bc40b68
|
|
| BLAKE2b-256 |
d471fc8fc7a853c4819bfe3db27a539f787715cc26863c40e481e261d61ea896
|
Provenance
The following attestation bundles were made for prizm_airflow_cli-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on DQLabs-Inc/prizm-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prizm_airflow_cli-0.1.1-py3-none-any.whl -
Subject digest:
0742124b701978aef400d9a34ba5494d3a319717d1cbba2e9667095a031961c6 - Sigstore transparency entry: 2501336290
- Sigstore integration time:
-
Permalink:
DQLabs-Inc/prizm-cli@279fd5c3802afaba442a91db8cccd40ac3a45c65 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DQLabs-Inc
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@279fd5c3802afaba442a91db8cccd40ac3a45c65 -
Trigger Event:
workflow_dispatch
-
Statement type: