Skip to main content

Apache Airflow API (Stable)

Reason this release was yanked:

Client has authentication issues

Project description

Apache Airflow Python Client

NOTE: The Apache Airflow Client is still under active development and some methods or APIs might be broken. Please raise an issue in github if you encounter any such issues.

Requirements.

Python >= 3.6

Installation & Usage

pip install

You can install directly using pip:

pip install apache-airflow-client

Setuptools

Or install via Setuptools.

git clone git@github.com:apache/airflow-client-python.git
cd airflow-client-python
python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import airflow_client.client

Getting Started

Please follow the installation procedure and then run the following:

import airflow_client.client
from pprint import pprint
from airflow_client.client.api import config_api

#
# In case of the basic authentication below. Make sure:
#  - Airflow is configured with the basic_auth as backend:
#     auth_backend = airflow.api.auth.backend.basic_auth
#  - Make sure that the client has been generated with securitySchema Basic.

# Configure HTTP basic authorization: Basic
configuration = airflow_client.client.Configuration(
    host="http://localhost/api/v1",
    username='admin',
    password='admin'
)


# Enter a context with an instance of the API client
with airflow_client.client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = config_api.ConfigApi(api_client)

    try:
        # Get current configuration
        api_response = api_instance.get_config()
        pprint(api_response)
    except airflow_client.client.ApiException as e:
        print("Exception when calling ConfigApi->get_config: %s\n" % e)

See README for full client API documentation.

Release Process

Typically releases are done coinciding with major and minor releases to Airflow. Therefore a release of (for example) 2.3.0 of this client would correspond with 2.3.X of Airflow.

The Python client is generated using Airflow's openapi spec. To update the client for new APIs do the following steps:

# clone this repo
git clone git@github.com:apache/airflow-client-python.git

# clone Airflow repo (if not already)
git clone git@github.com:apache/airflow.git

Edit the file airflow/airflow/api_connexion/openapi/v1.yaml Make sure it has the following securitySchemas listed under security section

security:
  - Basic: []
  - GoogleOpenId: []
  - Kerberos: []

If your deployment of Airflow uses any different authentication mechanism than the three listed above, you might need to make further changes to the v1.yaml and generate your own client, see OpenAPI Schema specification for details. (These changes should not be commited to the upstream v1.yaml as it will generate misleading openapi documentaion)

Update the VERSION string in setup.py with the corresponding new version string.

cd airflow

# bump up the version in python.sh & run the following command
./clients/gen/python.sh airflow/api_connexion/openapi/v1.yaml ../airflow-client-python/airflow_client

# raise a PR in github for both the repos (airflow & airflow-client-python)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apache-airflow-client-2.5.0.tar.gz (188.5 kB view details)

Uploaded Source

Built Distribution

apache_airflow_client-2.5.0-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file apache-airflow-client-2.5.0.tar.gz.

File metadata

  • Download URL: apache-airflow-client-2.5.0.tar.gz
  • Upload date:
  • Size: 188.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for apache-airflow-client-2.5.0.tar.gz
Algorithm Hash digest
SHA256 ec40627200d8899ca160916455f65de4def88819cc8b1df3086ec7be71c1fb33
MD5 be0af4f84f55391b6143aac7700e5316
BLAKE2b-256 302e06bed5bd9d831ecd5505fc214aa8c6d89a90da4760901f46a8223220f776

See more details on using hashes here.

File details

Details for the file apache_airflow_client-2.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for apache_airflow_client-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1ec2220d6d43000aceea8dd5f0e684709a07e739b8b5ac751d00c8ab9e038a6
MD5 7f82cd94f696c163c76c0ef5061cb6ba
BLAKE2b-256 2e36a06e4d405a2e2693345b229d2a0252a0b59309b61a0562c3eef36f431bc9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page