Skip to main content

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.11 or later.

To install using pip:

pip install google-cloud-datacatalog-lineage-producer-client

Before you begin

  1. Enable the Data Lineage API in your Google Cloud project.

  2. Make sure your principal has a role that allows reporting lineage, such as roles/datalineage.producer or roles/datalineage.editor.

  3. 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:

  1. Create a client
  2. Create a request object
  3. 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.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for google-cloud-datacatalog-lineage-producer-client 0.2.8
File Size Uploaded Provenance Actions
google_cloud_datacatalog_lineage_producer_client-0.2.8.tar.gz 18.9 kB With provenance Details for google_cloud_datacatalog_lineage_producer_client-0.2.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for google-cloud-datacatalog-lineage-producer-client 0.2.8
File Interpreter ABI Platform Actions
google_cloud_datacatalog_lineage_producer_client-0.2.8-py3-none-any.whl Python 3 none any Details for google_cloud_datacatalog_lineage_producer_client-0.2.8-py3-none-any.whl

Total release size: 49.5 kB

Release files / google_cloud_datacatalog_lineage_producer_client-0.2.8.tar.gz

Download URL google_cloud_datacatalog_lineage_producer_client-0.2.8.tar.gz
Size 18.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5b4a4ffdd2982b61823422018f46296ffc0bb01e229b9cbfe7b256ff0b67de18
BLAKE2b-256 checksum
How to use checksums
d361b7d326f993677cad645f8ca68a30b789f53b20ff6d2654793e69804c675c
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 Nov 24, 2026.

Transparency log

Release files / google_cloud_datacatalog_lineage_producer_client-0.2.8-py3-none-any.whl

Download URL google_cloud_datacatalog_lineage_producer_client-0.2.8-py3-none-any.whl
Size 30.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a2c49146b44d316a67378cf2a1873d738145f655b37533d54c1b26813ccf38d
BLAKE2b-256 checksum
How to use checksums
6b0638c9ebfac944858c8e069d404eaca5ec74ad980a0efdcc38e7087a216d9b
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 Nov 24, 2026.

Transparency log

Security for google-cloud-datacatalog-lineage-producer-client 0.2.8

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for google_cloud_datacatalog_lineage_producer_client-0.2.8.tar.gz

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 Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.8 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page