Data Lineage Producer Python Library
Python producer library for Data Lineage.
The library provides synchronous and asynchronous clients for interacting with the Data Lineage API.
Installation
Requires Python 3.9 or later.
To install using pip:
pip install google-cloud-datacatalog-lineage-producer-client
Before you begin
-
Enable the Data Lineage API in your Google Cloud project.
-
Make sure your principal has a role that allows reporting lineage, such as
roles/datalineage.producerorroles/datalineage.editor. -
Set up Application Default Credentials:
gcloud auth application-default login
Composing an OpenLineage message
open_lineage_message = {
"eventType": "COMPLETE",
"eventTime": "2023-04-04T13:21:16.098Z",
"producer": "producer-1",
"schemaURL": "https://openlineage.io/spec/1-0-5/OpenLineage.json#/$defs/RunEvent",
"job": {
"namespace": "namespace-1",
"name": "job-1",
},
"run": {
"runId": "1234-5678",
},
"inputs": [
{
"namespace": "bigquery",
"name": "input_project.input_dataset.input_table",
}
],
"outputs": [
{
"namespace": "bigquery",
"name": "output_project.output_dataset.output_table",
}
],
}
or, to convert it from an existing JSON string:
import json
open_lineage_message = json.loads(json_string)
Performing calls
To perform a call, you need to:
- Create a client
- Create a request object
- Call a corresponding method
parent is the project and location that the lineage is reported to, in the
format projects/PROJECT_ID/locations/LOCATION.
from google.cloud.datacatalog.lineage.producer_client.v1 import SyncLineageClient
from google.cloud.datacatalog_lineage_v1 import ProcessOpenLineageRunEventRequest
client = SyncLineageClient()
parent = "projects/PROJECT_ID/locations/LOCATION"
request = ProcessOpenLineageRunEventRequest(
parent=parent,
open_lineage=open_lineage_message,
)
response = client.process_open_lineage_run_event(request)
print(response)
For asynchronous calls:
import asyncio
from google.cloud.datacatalog.lineage.producer_client.v1 import AsyncLineageClient
from google.cloud.datacatalog_lineage_v1 import ProcessOpenLineageRunEventRequest
async def main():
client = AsyncLineageClient()
parent = "projects/PROJECT_ID/locations/LOCATION"
request = ProcessOpenLineageRunEventRequest(
parent=parent,
open_lineage=open_lineage_message,
)
response = await client.process_open_lineage_run_event(request)
print(response)
asyncio.run(main())
The response contains the names of the created process, run and lineage events.
Metadata
Release files for google-cloud-datacatalog-lineage-producer-client 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| google_cloud_datacatalog_lineage_producer_client-0.2.7.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| google_cloud_datacatalog_lineage_producer_client-0.2.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 49.5 kB
Release files / google_cloud_datacatalog_lineage_producer_client-0.2.7.tar.gz
| Download URL | google_cloud_datacatalog_lineage_producer_client-0.2.7.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c14c7968ea09ca30db964addc44e26200f9cca038e49c86f11f7b787f07c8535
|
|
BLAKE2b-256 checksum How to use checksums |
b813677dc4d8941a921e3c20493a2325c37c638565ad3d365a3277c8581b6265
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by Google Cloud, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / google_cloud_datacatalog_lineage_producer_client-0.2.7-py3-none-any.whl
| Download URL | google_cloud_datacatalog_lineage_producer_client-0.2.7-py3-none-any.whl |
|---|---|
| Size | 30.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a9bdb40a5526714d4f39037ccf9f5bdb7bb967d66a0deaec42b9749f1efde51
|
|
BLAKE2b-256 checksum How to use checksums |
d5645e9b8d4334f1b4683c7aab52bb6abea3ae0f836e382eb81b7479328b4a0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by Google Cloud, verified by PyPI on Sep 18, 2026.
Transparency log