Apache Airflow API (Stable)
Project description
Apache Airflow Python Client
Requirements.
Python >= 3.6
Installation & Usage
pip install
You can install directly using pip:
pip install git+https://github.com/apache/airflow-client-python.git
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
# The client must use the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
#
# In case of the basic authentication below, make sure that Airflow is
# configured with the basic_auth as backend:
#
# auth_backend = airflow.api.auth.backend.basic_auth
#
# Make sure that your user/name are configured properly
# 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
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
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
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
apache-airflow-client-2.0.0.tar.gz
(112.5 kB
view details)
Built Distribution
File details
Details for the file apache-airflow-client-2.0.0.tar.gz
.
File metadata
- Download URL: apache-airflow-client-2.0.0.tar.gz
- Upload date:
- Size: 112.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c76ced71fa98477812fa650465ccd279414aea6fa4db79e14b40f6d53df0b6e |
|
MD5 | 6bd5430acf0ddcd00cdef5e0647dcc9a |
|
BLAKE2b-256 | 5be3d92cd465788baaa87489caf193641bd4a09868479518c5716724e6bf922f |
File details
Details for the file apache_airflow_client-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: apache_airflow_client-2.0.0-py3-none-any.whl
- Upload date:
- Size: 760.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4bc0fc42c86142527a49ff1baad7629afc993c9e6cfb31b70dc0eddba90a7ac |
|
MD5 | a545d03fef715c3ca264aa6206ed9c95 |
|
BLAKE2b-256 | 25eacdb99955843f8e3a81c90885b0259d58d0f0e04e203d9d1de6cc4d65431a |