{"id":7145,"library":"dbt-artifacts-parser","title":"dbt-artifacts-parser","description":"A Python library for parsing dbt artifacts (like `manifest.json`, `run_results.json`, `catalog.json`) into strongly-typed Pydantic objects. It provides Python representations for various dbt artifact schemas, enabling easy programmatic access and manipulation of dbt project metadata and execution results. The library is actively maintained and frequently updated to support the latest stable dbt artifact versions.","status":"active","version":"0.13.1","language":"en","source_language":"en","source_url":"https://github.com/dbt-labs-community/dbt-artifacts-parser","tags":["dbt","data-build-tool","artifacts","manifest","run-results","catalog","pydantic","data-modeling","metadata"],"install":[{"cmd":"pip install dbt-artifacts-parser","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"parse_artifact","correct":"from dbt_artifacts_parser.parser import parse_artifact"},{"note":"Schema classes are versioned and located under `dbt_artifacts_parser.schema.*`. Always specify the correct version, e.g., `ManifestV10`, `ManifestV11`, etc., corresponding to your dbt artifact's schema version.","wrong":"from dbt_artifacts_parser.manifest import Manifest","symbol":"ManifestV10","correct":"from dbt_artifacts_parser.schema.manifest import ManifestV10"},{"note":"Similar to manifest, run results schemas are versioned and found under `dbt_artifacts_parser.schema.run_results`.","symbol":"RunResultsV1","correct":"from dbt_artifacts_parser.schema.run_results import RunResultsV1"}],"quickstart":{"code":"import json\nfrom dbt_artifacts_parser.parser import parse_artifact\nfrom dbt_artifacts_parser.schema.manifest import ManifestV10\n\n# In a real scenario, you'd load your manifest.json file, e.g.:\n# with open('path/to/manifest.json', 'r') as f:\n#     manifest_dict = json.load(f)\n\n# Example minimal valid manifest structure for demonstration\nmanifest_json_str = \"\"\"\n{\n  \"metadata\": {\n    \"dbt_schema_version\": \"https://schemas.getdbt.com/dbt/manifest/v10.json\",\n    \"dbt_version\": \"1.7.0\",\n    \"generated_at\": \"2023-10-27T10:00:00.000000Z\",\n    \"invocation_id\": \"test_invocation\",\n    \"env\": {},\n    \"adapter_type\": \"postgres\",\n    \"project_id\": \"test_project\",\n    \"user_id\": \"test_user\",\n    \"send_anonymous_usage_stats\": false,\n    \"cdd_id\": \"\"\n  },\n  \"nodes\": {},\n  \"sources\": {},\n  \"macros\": {},\n  \"docs\": {},\n  \"exposures\": {},\n  \"metrics\": {},\n  \"selectors\": {},\n  \"disabled\": {},\n  \"files\": {},\n  \"unit_tests\": {},\n  \"artifacts\": {}\n}\n\"\"\"\n\nmanifest_dict = json.loads(manifest_json_str)\n\n# Parse the dictionary into a strongly-typed Pydantic object\nmanifest = parse_artifact(manifest_dict, ManifestV10)\n\nprint(f\"Parsed dbt Manifest (dbt version: {manifest.metadata.dbt_version})\")\nprint(f\"Schema version: {manifest.metadata.dbt_schema_version}\")\nprint(f\"Number of nodes: {len(manifest.nodes)}\")\n","lang":"python","description":"This quickstart demonstrates how to load a dbt artifact JSON (here, a minimal manifest) and parse it into a Pydantic object using `parse_artifact` and the appropriate schema class (e.g., `ManifestV10`). You can then access artifact data via dot notation."},"warnings":[{"fix":"Always check the `dbt_schema_version` field in your artifact JSON (e.g., `\"dbt_schema_version\": \"https://schemas.getdbt.com/dbt/manifest/v10.json\"`) and use the corresponding Pydantic schema class (e.g., `ManifestV10`) from `dbt_artifacts_parser.schema.manifest`.","message":"Using an incorrect dbt artifact schema version (e.g., `ManifestV10` when your dbt project output `ManifestV11`). The `dbt-artifacts-parser` library supports specific dbt artifact schema versions. Using a schema class that doesn't match the `dbt_schema_version` found within your artifact JSON will lead to `ValidationError` or incomplete/incorrect parsing.","severity":"gotcha","affected_versions":"All versions"},{"fix":"After upgrading dbt, check the `dbt-artifacts-parser` changelog or documentation for compatible versions and required schema class updates. Upgrade `dbt-artifacts-parser` and adjust your imports/parsing logic accordingly.","message":"Breaking changes due to upstream dbt artifact schema updates. As dbt Labs releases new dbt versions, the underlying artifact schemas (like manifest.json structure) can change. While `dbt-artifacts-parser` aims to keep pace, if you upgrade your dbt project version, you may need to upgrade `dbt-artifacts-parser` and potentially update the specific schema class used in your parsing code (e.g., from `ManifestV10` to `ManifestV11`).","severity":"breaking","affected_versions":"All versions, especially with major dbt upgrades (e.g., dbt v1.0 to v1.1)"},{"fix":"If performance or memory becomes an issue, consider pre-processing large artifact files (e.g., using `jq` or streaming JSON parsers) to extract only the necessary parts before feeding them to `dbt-artifacts-parser`, or optimize your dbt project to reduce artifact size.","message":"Performance and memory usage with very large dbt artifact files. Parsing extremely large `manifest.json` or `run_results.json` files from complex dbt projects can be memory-intensive as the entire artifact is loaded into Python objects. This might lead to high memory consumption or slow processing times.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Verify that your dbt artifact file is valid and that you are using the correct schema class (e.g., `ManifestV10`) from `dbt_artifacts_parser.schema.*` that precisely matches the `dbt_schema_version` specified within your artifact JSON. Ensure your `dbt-artifacts-parser` library version is compatible with your dbt project's version.","cause":"The dbt artifact JSON does not conform to the expected Pydantic schema, often due to an incompatible dbt version, an incorrect schema class chosen, or a malformed artifact file.","error":"pydantic.v1.error_wrappers.ValidationError: ..."},{"fix":"Install the library using `pip install dbt-artifacts-parser`. Double-check your import statement for correctness, e.g., `from dbt_artifacts_parser.parser import parse_artifact`.","cause":"The `dbt-artifacts-parser` library is not installed in your Python environment or the import path specified in your code is incorrect.","error":"ModuleNotFoundError: No module named 'dbt_artifacts_parser.parser'"},{"fix":"Verify the absolute or relative path to your dbt artifact file. Ensure the file is present at the location specified in your code and that your application has read permissions for the file.","cause":"The specified path to the dbt artifact file (e.g., `manifest.json`, `run_results.json`) is incorrect, or the file does not exist at the given location.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'path/to/manifest.json'"}]}