Skip to main content

A dbt artifacts parser in python

Project description

Test python Package version Supported Python versions

dbt-artifacts-parser

This is a dbt artifacts parse in python. It enables us to deal with catalog.json, manifest.json, run-results.json and sources.json as python objects.

Installation

pip install -U dbt-artifacts-parser

Python classes

Those are the classes to parse dbt artifacts.

Catalog

Manifest

Run Results

Sources

Examples

Parse catalog.json

import yaml

# parse any version of catalog.json
from dbt_artifacts_parser.parser import parse_catalog

with open("path/to/catalog.json", "r") as fp:
    catalog_dict = yaml.safe_load(fp)
    catalog_obj = parse_catalog(catalog=catalog_dict)

# parse catalog.json v1
from dbt_artifacts_parser.parser import parse_catalog_v1

with open("path/to/catalog.json", "r") as fp:
    catalog_dict = yaml.safe_load(fp)
    catalog_obj = parse_catalog_v1(catalog=catalog_dict)

Parse manifest.json

import yaml

# parse any version of manifest.json
from dbt_artifacts_parser.parser import parse_manifest

with open("path/to/manifest.json", "r") as fp:
    manifest_dict = yaml.safe_load(fp)
    manifest_obj = parse_manifest(manifest=manifest_dict)

# parse manifest.json v1
from dbt_artifacts_parser.parser import parse_manifest_v1

with open("path/to/manifest.json", "r") as fp:
    manifest_dict = yaml.safe_load(fp)
    manifest_obj = parse_manifest_v1(manifest=manifest_dict)

# parse manifest.json v2
from dbt_artifacts_parser.parser import parse_manifest_v2

with open("path/to/manifest.json", "r") as fp:
    manifest_dict = yaml.safe_load(fp)
    manifest_obj = parse_manifest_v2(manifest=manifest_dict)

# parse manifest.json v3
from dbt_artifacts_parser.parser import parse_manifest_v3

with open("path/to/manifest.json", "r") as fp:
    manifest_dict = yaml.safe_load(fp)
    manifest_obj = parse_manifest_v3(manifest=manifest_dict)

# parse manifest.json v4
from dbt_artifacts_parser.parser import parse_manifest_v4

with open("path/to/manifest.json", "r") as fp:
    manifest_dict = yaml.safe_load(fp)
    manifest_obj = parse_manifest_v4(manifest=manifest_dict)

Parse run-results.json

import yaml

# parse any version of run-results.json
from dbt_artifacts_parser.parser import parse_run_results

with open("path/to/run-resultsjson", "r") as fp:
    run_results_dict = yaml.safe_load(fp)
    run_results_obj = parse_run_results(run_results=run_results_dict)

# parse run-results.json v1
from dbt_artifacts_parser.parser import parse_run_results_v1

with open("path/to/run-results.json", "r") as fp:
    run_results_dict = yaml.safe_load(fp)
    run_results_obj = parse_run_results_v1(run_results=run_results_dict)

# parse run-results.json v2
from dbt_artifacts_parser.parser import parse_run_results_v2

with open("path/to/run-results.json", "r") as fp:
    run_results_dict = yaml.safe_load(fp)
    run_results_obj = parse_run_results_v2(run_results=run_results_dict)

# parse run-results.json v3
from dbt_artifacts_parser.parser import parse_run_results_v3

with open("path/to/run-results.json", "r") as fp:
    run_results_dict = yaml.safe_load(fp)
    run_results_obj = parse_run_results_v3(run_results=run_results_dict)

# parse run-results.json v4
from dbt_artifacts_parser.parser import parse_run_results_v4

with open("path/to/run-results.json", "r") as fp:
    run_results_dict = yaml.safe_load(fp)
    run_results_obj = parse_run_results_v4(run_results=run_results_dict)

Parse sources.json

import yaml

# parse any version of sources.json
from dbt_artifacts_parser.parser import parse_sources

with open("path/to/sources.json", "r") as fp:
    sources_dict = yaml.safe_load(fp)
    sources_obj = parse_sources(sources=sources_dict)

# parse sources.json v1
from dbt_artifacts_parser.parser import parse_sources_v1

with open("path/to/sources.json", "r") as fp:
    sources_dict = yaml.safe_load(fp)
    sources_obj = parse_sources_v1(sources=sources_dict)

# parse sources.json v2
from dbt_artifacts_parser.parser import parse_sources_v2

with open("path/to/sources.json", "r") as fp:
    sources_dict = yaml.safe_load(fp)
    sources_obj = parse_sources_v2(sources=sources_dict)

# parse sources.json v3
from dbt_artifacts_parser.parser import parse_sources_v3

with open("path/to/sources.json", "r") as fp:
    sources_dict = yaml.safe_load(fp)
    sources_obj = parse_sources_v3(sources=sources_dict)

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

dbt-artifacts-parser-0.1.0.tar.gz (185.6 kB view details)

Uploaded Source

Built Distribution

dbt_artifacts_parser-0.1.0-py3-none-any.whl (79.5 kB view details)

Uploaded Python 3

File details

Details for the file dbt-artifacts-parser-0.1.0.tar.gz.

File metadata

  • Download URL: dbt-artifacts-parser-0.1.0.tar.gz
  • Upload date:
  • Size: 185.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for dbt-artifacts-parser-0.1.0.tar.gz
Algorithm Hash digest
SHA256 23f94accdbc5805c25286908c8592e2fcf5ec5033c16cc8eb51b372290483a16
MD5 5927e9303942417c9d224cb79f3aca38
BLAKE2b-256 26c514e1eedc63b416c1387c174381549ac5c1b352665b8632be0084e4914df2

See more details on using hashes here.

File details

Details for the file dbt_artifacts_parser-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dbt_artifacts_parser-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18933eaad4492b95e51995f5c38aef9e0b5aaf4be41914ed76ff30fff9fc6033
MD5 853e2da2a9a2eb997fbf6d63be4cfa76
BLAKE2b-256 a25d6f5d05891f80a18baf3fc287105cc1e9142192337a35ceb14bd7f106d020

See more details on using hashes here.

Supported by

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