Skip to main content

OpenLineage Python Client

Project description

OpenLineage-python

To install from source, run:

$ python setup.py install

Configuration

Config file

The most common way to configure the OpenLineage Client is by .yaml file, which contains all the details of how to connect to your OpenLineage backend.

The config file is located by:

  1. looking at the OPENLINEAGE_CONFIG environment variable
  2. looking for the openlineage.yml file in the current working directory
  3. looking for the openlineage.yml file in the $HOME/.openlineage directory.

Different ways of connecting to OpenLineage backend are supported by the standarized Transport interface.
This is an example config for specifying http transport:

transport:
  type: "http"
  url: "https://backend:5000"
  auth:
    type: "api_key"
    api_key: "f048521b-dfe8-47cd-9c65-0cb07d57591e"

The type property is required. It can be one of the built-in transports or a custom one. There are three built-in transports, http, kafka and console. Custom transports type is a fully qualified class name that can be imported.

The rest of the properties are defined by the particular transport.
Specifications for the built-in options are below.

HTTP

  • url - required string parameter.
  • endpoint - optional string parameter specifying the endpoint to which events are sent. By default api/v1/lineage.
  • timeout - optional float parameter specifying the timeout when sending events. By default 5 seconds.
  • verify optional boolean attribute specifying if the client should verify TLS certificates of the backend. By default true.
  • auth - optional dictionary specifying authentication options. The type property is required.
    • type: required property if an auth dictionary is set. Set to api_key or to the fully qualified class name of your TokenProvider.
    • api_key: if api_key type is set, it sets value at Authentication HTTP header as Bearer.

Kafka

For KafkaTransport, confluent-kafka needs to be installed. You can also install pip install openlineage-python[kafka]

  • config - required string parameter. A dictionary that contains a Kafka producer config as in Kafka producer config.
  • topic - required string parameter. The topic on what events will be sent.
  • flush - optional boolean parameter. If set to True, Kafka will flush after each event. By default true.

Custom transport

To implement a custom transport, follow the instructions in the openlineage/client/transport/transport.py file.

Config as env vars

If there is no config file found, the OpenLineage client looks at environment variables.
This way of configuring the client supports only http transport, and only a subset of its config.

  • OPENLINEAGE_URL - point to the service that will consume OpenLineage events.
  • OPENLINEAGE_API_KEY - set if the consumer of OpenLineage events requires a Bearer authentication key.

OPENLINEAGE_URL and OPENLINEAGE_API_KEY can also be set up manually when creating a client instance.

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

openlineage-python-0.20.6.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openlineage_python-0.20.6-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file openlineage-python-0.20.6.tar.gz.

File metadata

  • Download URL: openlineage-python-0.20.6.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for openlineage-python-0.20.6.tar.gz
Algorithm Hash digest
SHA256 a9b92aa20de5244b0640a4185b018e988da28e1a37fdaa1c9657cafdf0543140
MD5 401041c23440ea37bca84a25277b52ae
BLAKE2b-256 f671f0b0651fd13ac5ee82a16d3a239480a6288f8f5c5f08b137135e7dcb54bd

See more details on using hashes here.

File details

Details for the file openlineage_python-0.20.6-py3-none-any.whl.

File metadata

File hashes

Hashes for openlineage_python-0.20.6-py3-none-any.whl
Algorithm Hash digest
SHA256 eb8ab5a1435825e265506e3851c347478162bd8f5c31782b31e34106d07bea15
MD5 8f4d190f3583cee13879507094b8e9df
BLAKE2b-256 e29d95d3d3e20a16e3293845dd92bcedbf4262a30709772527465249b1b54479

See more details on using hashes here.

Supported by

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