Registry / workflow / apache-airflow-client

apache-airflow-client

JSON →
library3.3.1pypypi✓ verified 22d ago

The `apache-airflow-client` library provides a Pythonic way to interact with the Apache Airflow REST API. It is an auto-generated client based on Airflow's OpenAPI specification, ensuring it remains up-to-date with the latest Airflow API versions. This library allows programmatic control and querying of Airflow DAGs, tasks, and other components. It primarily follows Airflow's release cadence, regenerating with each new Airflow release, currently at version 3.2.0.

pip install apache-airflow-client
INSTALL
IMPORT
SIG · APACHE-AIRFLOW-CLI
A
apache-airflow-client
workflowpythonv3.3.1
Install
3.8s avg
Import
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.3.1 · 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.000s · 35.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.8s · import 0.000s · 35MB
34MB installed
● package 34MB
Code
Verified usage

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

APIClient
from airflow_client.client import APIClient
from airflow_client.client import APIClient

Initializes the Airflow API client with basic authentication using environment variables for host, username, and password. It then attempts to connect to the Airflow instance and list all available DAGs, demonstrating a fundamental API interaction.

import os from airflow_client.client.configuration import Configuration from airflow_client.client.api_client import APIClient from airflow_client.client.api.dag_api import DagApi # Configure API client with Airflow host, username, and password # Using environment variables for sensitive data is recommended. configuration = Configuration( host=os.environ.get("AIRFLOW_HOST", "http://localhost:8080/api/v1"), username=os.environ.get("AIRFLOW_USERNAME", "admin"), password=os.environ.get("AIRFLOW_PASSWORD", "admin") ) # Create an instance of the API client # The 'with' statement ensures proper connection handling with APIClient(configuration) as api_client: # Create an instance of a specific API endpoint, e.g., DagApi api_instance = DagApi(api_client=api_client) try: # Make an API call, e.g., list DAGs api_response = api_instance.get_dags() print("Successfully connected to Airflow API and fetched DAGs:") if api_response.dags: for dag in api_response.dags: print(f"- {dag.dag_id}") else: print("No DAGs found.") except Exception as e: print(f"An error occurred: {e}") print("Ensure Airflow is running and accessible at the specified host, and credentials are correct.")
Debug
Known issues
breakingMajor version updates (e.g., v1.x to v2.x, or v2.x to v3.x) of `apache-airflow-client` may introduce breaking changes due to client regeneration from updated OpenAPI specifications or internal changes in the client generator. This can alter module paths, class structures, or method signatures.
fix
Always review the changelog or GitHub releases when upgrading major versions. Update import paths and API calls according to the new client structure and Airflow API specification. Test thoroughly in a staging environment.
affects: All versions, particularly when upgrading across major client versions.
gotchaThe `apache-airflow-client` must be compatible with the Airflow API version it's connecting to. Using a client generated for an older Airflow API with a newer Airflow instance (or vice-versa) can lead to unexpected errors, missing endpoints, or incorrect data models.
fix
Ensure your `apache-airflow-client` version is kept up-to-date and aligns with the Apache Airflow API version it was generated against. Refer to the client's GitHub README or release notes for its targeted Airflow API version to avoid compatibility issues.
affects: All
gotchaThe client primarily supports Basic Authentication. If your Airflow instance is configured with a different authentication mechanism (e.g., Google SSO, OAuth, Keycloak), direct usage of the `Configuration(username=..., password=...)` may not work.
fix
For non-Basic Auth setups, you may need to manually manage authentication tokens and pass them via custom headers to the APIClient, or consider using a different method if the client doesn't explicitly support your Airflow's auth backend. Refer to Airflow's documentation on API authentication for details.
affects: All
Upgrade
Version history
3.3.1latest on PyPI · released Aug 17, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
57 hits · last 30 days
node
46
OpenAI (training)
1
Resources
apache-airflow-client — pip install apache-airflow-client · libregistry