Update Changelog & setup.py
2 files changed
tree: 01a28c195d796c3668fdd5edf4a77c405a686c82
  1. .github/
  2. airflow_client/
  3. license-templates/
  4. .asf.yaml
  5. .gitignore
  6. .pre-commit-config.yaml
  7. CHANGELOG.md
  8. INSTALL
  9. LICENSE
  10. README.md
  11. requirements.txt
  12. setup.cfg
  13. setup.py
  14. test-requirements.txt
README.md

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 time import airflow_client.client from pprint import pprint from airflow_client.client.api import config_api from airflow_client.client.model.config import Config from airflow_client.client.model.error import Error # Defining the host is optional and defaults to http://localhost/api/v1 # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost/api/v1" ) # The client must configure 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. # Configure HTTP basic authorization: Basic configuration = airflow_client.client.Configuration( host = "http://localhost/api/v1", username = 'YOUR_USERNAME', password = 'YOUR_PASSWORD' ) # 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)