Apache Airflow API (Stable)
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
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 securitySchema
s 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)
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
Built Distribution
File details
Details for the file apache-airflow-client-2.3.0.tar.gz
.
File metadata
- Download URL: apache-airflow-client-2.3.0.tar.gz
- Upload date:
- Size: 156.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.12.0 pkginfo/1.7.0 requests/2.28.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26453f20759e20a71233327c60dd26748bb64454091e277f70596b1a418b4d36 |
|
MD5 | 771d9f02e5e0ba6dd4b08e6e2a0691d8 |
|
BLAKE2b-256 | 7be048ed9f32965d5ad29016f938eeec08b6d3d2a6149e06b3a5295884c246cc |
File details
Details for the file apache_airflow_client-2.3.0-py3-none-any.whl
.
File metadata
- Download URL: apache_airflow_client-2.3.0-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.12.0 pkginfo/1.7.0 requests/2.28.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53e42b94e74d72d53457d52b54a91019d3e9e683ce0b4a84dfdb195f5d934c24 |
|
MD5 | 5c10a81577e30d671e7d7aadf7a2a0d7 |
|
BLAKE2b-256 | a36767a53272e148332f8962af5b9367e2930a82bbe89079b99182bdb2bd2e72 |