Skip to main content

python package to extract CLL from dbt files

Project description

py-dbt-cll

Python packages that extracts column lineage information from dbt models based on their metadata in the manifest file. It does not require any connection to the database and it only uses sqlGlot to extract the column level lineage information from a SQL query. Before the query is passed into sqlGlot, the query is modified with additional information from the manifest file, so that the column lineage can be accurately determined.

Installation

You can install the package using pip:

pip install py-dbt-cll

Usage

Import the module.

from py_dbt_cll.dbt_lineage import DbtCLL

Load your manifest file

with open("tests/manifest.json", "r", encoding="utf-8") as file:
    manifest_data = json.load(file)
ccl = DbtCLL(manifest_data)

sql = """
    select *
    from (
        select *
        from ...
    ) as final
"""
columns = ["academic_year_id", "date_id"]
lineage = ccl.extract_cll(sql, columns, debug=False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_dbt_cll-0.1.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

py_dbt_cll-0.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file py_dbt_cll-0.1.2.tar.gz.

File metadata

  • Download URL: py_dbt_cll-0.1.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for py_dbt_cll-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0185f77fb74f6861df4e11d8b54341d601fca926a642c74506abe79ba564e324
MD5 b00be7e625c478c5b8888e02a61e701b
BLAKE2b-256 0d8a6ee80e61656e47bb8353f355c5729ba04ca0cc6d5bd5cf6d2faf5ad63705

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_dbt_cll-0.1.2.tar.gz:

Publisher: publish.yml on ngmiduc/py-dbt-cll

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_dbt_cll-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: py_dbt_cll-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for py_dbt_cll-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c1b3a180d28d5d437eab2c452b5bc5213a4d39cce9a5e531d062744ef29e824
MD5 96b5419bc4d1633c14a6d91691b2f4f8
BLAKE2b-256 c3c16c1489485f6883e7dbdaa4a971991429191b1d82e1abe01b0486fe5d40e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_dbt_cll-0.1.2-py3-none-any.whl:

Publisher: publish.yml on ngmiduc/py-dbt-cll

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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