A dbt artifacts parser in python
Project description
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
- CatalogV1 for catalog.json v1
Manifest
- ManifestV1 for manifest.json v1
- ManifestV2 for manifest.json v2
- ManifestV3 for manifest.json v3
- ManifestV4 for manifest.json v4
- ManifestV5 for manifest.json v5
- ManifestV6 for manifest.json v6
- ManifestV7 for manifest.json v7
- ManifestV8 for manifest.json v8
- ManifestV9 for manifest.json v9
Run Results
- RunResultsV1 for run_results.json v1
- RunResultsV2 for run_results.json v2
- RunResultsV3 for run_results.json v3
- RunResultsV4 for run_results.json v4
Sources
Examples
Parse catalog.json
import json
# 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 = json.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 = json.load(fp)
catalog_obj = parse_catalog_v1(catalog=catalog_dict)
Parse manifest.json
import json
# 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 = json.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 = json.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 = json.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 = json.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 = json.load(fp)
manifest_obj = parse_manifest_v4(manifest=manifest_dict)
# parse manifest.json v5
from dbt_artifacts_parser.parser import parse_manifest_v5
with open("path/to/manifest.json", "r") as fp:
manifest_dict = json.load(fp)
manifest_obj = parse_manifest_v5(manifest=manifest_dict)
# parse manifest.json v6
from dbt_artifacts_parser.parser import parse_manifest_v6
with open("path/to/manifest.json", "r") as fp:
manifest_dict = json.load(fp)
manifest_obj = parse_manifest_v6(manifest=manifest_dict)
# parse manifest.json v7
from dbt_artifacts_parser.parser import parse_manifest_v7
with open("path/to/manifest.json", "r") as fp:
manifest_dict = json.load(fp)
manifest_obj = parse_manifest_v7(manifest=manifest_dict)
# parse manifest.json v8
from dbt_artifacts_parser.parser import parse_manifest_v8
with open("path/to/manifest.json", "r") as fp:
manifest_dict = json.load(fp)
manifest_obj = parse_manifest_v8(manifest=manifest_dict)
# parse manifest.json v9
from dbt_artifacts_parser.parser import parse_manifest_v9
with open("path/to/manifest.json", "r") as fp:
manifest_dict = json.load(fp)
manifest_obj = parse_manifest_v9(manifest=manifest_dict)
Parse run-results.json
import json
# 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 = json.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 = json.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 = json.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 = json.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 = json.load(fp)
run_results_obj = parse_run_results_v4(run_results=run_results_dict)
Parse sources.json
import json
# 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 = json.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 = json.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 = json.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 = json.load(fp)
sources_obj = parse_sources_v3(sources=sources_dict)
Contributors
Yu Ishikawa |
Brent Brewington |
Judah Rand |
Mohamed Nabil Mahmoud Hafez |
Null |
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
dbt_artifacts_parser-0.3.2.tar.gz
(100.8 kB
view details)
Built Distribution
File details
Details for the file dbt_artifacts_parser-0.3.2.tar.gz
.
File metadata
- Download URL: dbt_artifacts_parser-0.3.2.tar.gz
- Upload date:
- Size: 100.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 289d0f2cfcdcd52355225a84c67547fd6f25541e1b492cb6db1afc203e062e07 |
|
MD5 | 59a3c7a54cb5fdc73b1273495bd7e50d |
|
BLAKE2b-256 | fb9b62f085e5766218840a47c471acff7b435388faca459804cf3c6f9f01f15f |
File details
Details for the file dbt_artifacts_parser-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: dbt_artifacts_parser-0.3.2-py3-none-any.whl
- Upload date:
- Size: 142.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8925f784224a68b1f08e8e0a51f761e48d9b7a24d1a72e51dbf9110b57b7c9 |
|
MD5 | c6179a25e0e73cd13af06d81865ada9f |
|
BLAKE2b-256 | 9b1201f3956cc62beb84498368eb12a2fdae6b676dc7c136bf2fbbc74f3e6cd1 |