artifact-parser 1.1.0__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. artifact_parser-2.0.0/PKG-INFO +91 -0
  2. artifact_parser-2.0.0/README.md +61 -0
  3. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/pyproject.toml +14 -20
  4. artifact_parser-2.0.0/rust/Cargo.lock +253 -0
  5. artifact_parser-2.0.0/rust/Cargo.toml +18 -0
  6. artifact_parser-2.0.0/rust/src/lib.rs +37 -0
  7. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/__init__.py +2 -3
  8. artifact_parser-2.0.0/src/artifact_parser/_native.pyi +1 -0
  9. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/__init__.py +4 -0
  10. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v1.py +38 -33
  11. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v10.py +29 -23
  12. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v11.py +30 -16
  13. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v12.py +33 -19
  14. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v2.py +38 -33
  15. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v3.py +38 -33
  16. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v4.py +42 -37
  17. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v5.py +42 -37
  18. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v6.py +42 -37
  19. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v7.py +44 -38
  20. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v8.py +26 -20
  21. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v9.py +28 -22
  22. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/parser.py +64 -46
  23. artifact_parser-2.0.0/src/artifact_parser/dbt/generated/version_map.py +142 -0
  24. artifact_parser-2.0.0/src/artifact_parser/dbt/known_or_text.py +23 -0
  25. artifact_parser-2.0.0/src/artifact_parser/dbt/lazy_artifact.py +71 -0
  26. artifact_parser-2.0.0/src/artifact_parser/dbt/lazy_section.py +35 -0
  27. artifact_parser-2.0.0/src/artifact_parser/dbt/resource_union.py +55 -0
  28. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/utils.py +4 -3
  29. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/__init__.py +18 -3
  30. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt/generator.py +38 -0
  31. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt/templates/parser.py.jinja +10 -4
  32. artifact_parser-2.0.0/src/codegen/dbt/templates/version_map.py.jinja +39 -0
  33. artifact_parser-1.1.0/.gitignore +0 -218
  34. artifact_parser-1.1.0/PKG-INFO +0 -233
  35. artifact_parser-1.1.0/README.md +0 -204
  36. artifact_parser-1.1.0/src/artifact_parser/dbt/generated/version_map.py +0 -112
  37. artifact_parser-1.1.0/src/codegen/dbt/templates/version_map.py.jinja +0 -31
  38. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/LICENSE +0 -0
  39. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/core/__init__.py +0 -0
  40. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/core/base.py +0 -0
  41. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/core/exceptions.py +0 -0
  42. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/core/parser.py +0 -0
  43. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/core/registry.py +0 -0
  44. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/__init__.py +0 -0
  45. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/__init__.py +0 -0
  46. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/catalog/__init__.py +0 -0
  47. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/catalog/catalog_v1.py +0 -0
  48. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/__init__.py +0 -0
  49. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/__init__.py +0 -0
  50. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v1.py +0 -0
  51. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v2.py +0 -0
  52. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v3.py +0 -0
  53. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v4.py +0 -0
  54. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v5.py +0 -0
  55. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v6.py +0 -0
  56. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/sources/__init__.py +0 -0
  57. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/sources/sources_v1.py +0 -0
  58. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/sources/sources_v2.py +0 -0
  59. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/sources/sources_v3.py +0 -0
  60. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/plugin.py +0 -0
  61. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/catalog/catalog_v1.json +0 -0
  62. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v1.json +0 -0
  63. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v10.json +0 -0
  64. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v11.json +0 -0
  65. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v12.json +0 -0
  66. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v2.json +0 -0
  67. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v3.json +0 -0
  68. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v4.json +0 -0
  69. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v5.json +0 -0
  70. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v6.json +0 -0
  71. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v7.json +0 -0
  72. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v8.json +0 -0
  73. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v9.json +0 -0
  74. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v1.json +0 -0
  75. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v2.json +0 -0
  76. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v3.json +0 -0
  77. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v4.json +0 -0
  78. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v5.json +0 -0
  79. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v6.json +0 -0
  80. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/sources/sources_v1.json +0 -0
  81. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/sources/sources_v2.json +0 -0
  82. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/sources/sources_v3.json +0 -0
  83. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/base.py +0 -0
  84. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/generated/__init__.py +0 -0
  85. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/generated/models/__init__.py +0 -0
  86. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/generated/models/info_schema_v1.py +0 -0
  87. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/loader.py +0 -0
  88. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/plugin.py +0 -0
  89. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/resources/info_schema_v1.json +0 -0
  90. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/dbt_info_schema/utils.py +0 -0
  91. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/artifact_parser/py.typed +0 -0
  92. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/__init__.py +0 -0
  93. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/__main__.py +0 -0
  94. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/cli.py +0 -0
  95. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt/__init__.py +0 -0
  96. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt/artifact_spec.py +0 -0
  97. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt/paths.py +0 -0
  98. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt/templates/generated_init.py.jinja +0 -0
  99. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt/templates/versions.py.jinja +0 -0
  100. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt/versions.py +0 -0
  101. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt_info_schema/__init__.py +0 -0
  102. {artifact_parser-1.1.0 → artifact_parser-2.0.0}/src/codegen/dbt_info_schema/generator.py +0 -0
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: artifact-parser
3
+ Version: 2.0.0
4
+ Classifier: Environment :: Console
5
+ Classifier: Operating System :: OS Independent
6
+ Classifier: Programming Language :: Python :: 3.10
7
+ Classifier: Programming Language :: Python :: 3.11
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: Programming Language :: Python :: 3.13
10
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
11
+ Requires-Dist: pydantic>=2.2
12
+ Requires-Dist: datamodel-code-generator>=0.63.0 ; extra == 'codegen'
13
+ Requires-Dist: jinja2>=3.1 ; extra == 'codegen'
14
+ Requires-Dist: typer>=0.26.7 ; extra == 'codegen'
15
+ Requires-Dist: pyarrow>=15 ; extra == 'codegen'
16
+ Requires-Dist: pyarrow>=15 ; extra == 'info-schema'
17
+ Provides-Extra: codegen
18
+ Provides-Extra: dbt
19
+ Provides-Extra: info-schema
20
+ License-File: LICENSE
21
+ Summary: A pluggable framework for parsing data tool artifacts into typed Python models — dbt-core first.
22
+ Keywords: dbt,artifacts,manifest,catalog,parser,pydantic
23
+ Author-email: Dat Nguyen <datnguyen.it09@gmail.com>
24
+ License: MIT
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
27
+ Project-URL: Homepage, https://github.com/datnguye/artifact-parser
28
+ Project-URL: Repository, https://github.com/datnguye/artifact-parser
29
+
30
+ <div style="display: flex; align-items: center; justify-content: space-between;">
31
+ <div>
32
+ <h1 style="margin: 0;">artifact-parser</h1>
33
+ <p style="margin: 0;">Turn data-tool JSON artifacts into typed, validated Python objects</p>
34
+ </div>
35
+ <img src="docs/assets/logo.svg" alt="artifact-parser logo" width="270" height="60">
36
+ </div>
37
+
38
+ [![PyPI version](https://badge.fury.io/py/artifact-parser.svg)](https://pypi.org/project/artifact-parser/)
39
+ ![python-lib](https://img.shields.io/badge/Library-Python-FFCE3E?labelColor=14354C&logo=python&logoColor=white)
40
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
41
+ [![python](https://img.shields.io/badge/Python-3.10|3.11|3.12|3.13-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)
42
+ [![CI](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml)
43
+ [![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?style=flat&logo=pytest&logoColor=white)](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml)
44
+
45
+ [![artifact-parser stars](https://img.shields.io/github/stars/datnguye/artifact-parser.svg?logo=github&style=for-the-badge&label=Star%20this%20repo)](https://github.com/datnguye/artifact-parser)
46
+ [![buy me a coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?logo=buy-me-a-coffee&logoColor=white&labelColor=ff813f&style=for-the-badge)](https://www.buymeacoffee.com/datnguye)
47
+
48
+ Point it at a file dbt wrote and get back a typed, validated Python object. No key-spelunking, no guessing which schema version you're holding.
49
+
50
+ ## Install
51
+
52
+ ```bash
53
+ pip install artifact-parser
54
+ ```
55
+
56
+ ## Use
57
+
58
+ ```python
59
+ import json
60
+ from artifact_parser import parse
61
+
62
+ with open("target/manifest.json") as file:
63
+ manifest = parse(json.load(file))
64
+
65
+ print(manifest.metadata.dbt_version)
66
+ ```
67
+
68
+ It reads manifests, catalogs, run results and sources from dbt 1 and 2. Is your manifest huge? Read it a node at a time:
69
+
70
+ ```python
71
+ from artifact_parser.dbt import parse_file
72
+
73
+ for node in parse_file("target/manifest.json").nodes.values():
74
+ print(node.name)
75
+ ```
76
+
77
+ ## Learn more
78
+
79
+ - [User guide](https://github.com/datnguye/artifact-parser/blob/main/docs/site/index.md)
80
+ - [Upgrade to 2.0](https://github.com/datnguye/artifact-parser/blob/main/docs/site/upgrade-2.0.md)
81
+ - [Contributing](https://github.com/datnguye/artifact-parser/blob/main/CONTRIBUTING.md)
82
+
83
+ ## Support
84
+
85
+ If this saved you from hand-spelunking a `manifest.json`, consider fuelling the
86
+ next release:
87
+
88
+ - ☕ [Buy me a coffee](https://www.buymeacoffee.com/datnguye)
89
+
90
+ [![buy me a coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?logo=buy-me-a-coffee&logoColor=white&labelColor=ff813f&style=for-the-badge)](https://www.buymeacoffee.com/datnguye)
91
+
@@ -0,0 +1,61 @@
1
+ <div style="display: flex; align-items: center; justify-content: space-between;">
2
+ <div>
3
+ <h1 style="margin: 0;">artifact-parser</h1>
4
+ <p style="margin: 0;">Turn data-tool JSON artifacts into typed, validated Python objects</p>
5
+ </div>
6
+ <img src="docs/assets/logo.svg" alt="artifact-parser logo" width="270" height="60">
7
+ </div>
8
+
9
+ [![PyPI version](https://badge.fury.io/py/artifact-parser.svg)](https://pypi.org/project/artifact-parser/)
10
+ ![python-lib](https://img.shields.io/badge/Library-Python-FFCE3E?labelColor=14354C&logo=python&logoColor=white)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
12
+ [![python](https://img.shields.io/badge/Python-3.10|3.11|3.12|3.13-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)
13
+ [![CI](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml)
14
+ [![coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?style=flat&logo=pytest&logoColor=white)](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml)
15
+
16
+ [![artifact-parser stars](https://img.shields.io/github/stars/datnguye/artifact-parser.svg?logo=github&style=for-the-badge&label=Star%20this%20repo)](https://github.com/datnguye/artifact-parser)
17
+ [![buy me a coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?logo=buy-me-a-coffee&logoColor=white&labelColor=ff813f&style=for-the-badge)](https://www.buymeacoffee.com/datnguye)
18
+
19
+ Point it at a file dbt wrote and get back a typed, validated Python object. No key-spelunking, no guessing which schema version you're holding.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ pip install artifact-parser
25
+ ```
26
+
27
+ ## Use
28
+
29
+ ```python
30
+ import json
31
+ from artifact_parser import parse
32
+
33
+ with open("target/manifest.json") as file:
34
+ manifest = parse(json.load(file))
35
+
36
+ print(manifest.metadata.dbt_version)
37
+ ```
38
+
39
+ It reads manifests, catalogs, run results and sources from dbt 1 and 2. Is your manifest huge? Read it a node at a time:
40
+
41
+ ```python
42
+ from artifact_parser.dbt import parse_file
43
+
44
+ for node in parse_file("target/manifest.json").nodes.values():
45
+ print(node.name)
46
+ ```
47
+
48
+ ## Learn more
49
+
50
+ - [User guide](https://github.com/datnguye/artifact-parser/blob/main/docs/site/index.md)
51
+ - [Upgrade to 2.0](https://github.com/datnguye/artifact-parser/blob/main/docs/site/upgrade-2.0.md)
52
+ - [Contributing](https://github.com/datnguye/artifact-parser/blob/main/CONTRIBUTING.md)
53
+
54
+ ## Support
55
+
56
+ If this saved you from hand-spelunking a `manifest.json`, consider fuelling the
57
+ next release:
58
+
59
+ - ☕ [Buy me a coffee](https://www.buymeacoffee.com/datnguye)
60
+
61
+ [![buy me a coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?logo=buy-me-a-coffee&logoColor=white&labelColor=ff813f&style=for-the-badge)](https://www.buymeacoffee.com/datnguye)
@@ -17,7 +17,7 @@ classifiers = [
17
17
  "Topic :: Software Development :: Libraries :: Python Modules",
18
18
  ]
19
19
  dependencies = [
20
- "pydantic>=2.0",
20
+ "pydantic>=2.2",
21
21
  ]
22
22
 
23
23
  [project.optional-dependencies]
@@ -38,27 +38,20 @@ Homepage = "https://github.com/datnguye/artifact-parser"
38
38
  Repository = "https://github.com/datnguye/artifact-parser"
39
39
 
40
40
  [build-system]
41
- requires = ["hatchling", "hatch-vcs"]
42
- build-backend = "hatchling.build"
41
+ requires = ["maturin>=1.9,<2"]
42
+ build-backend = "maturin"
43
43
 
44
- [tool.hatch.version]
45
- source = "vcs"
44
+ [tool.maturin]
45
+ manifest-path = "rust/Cargo.toml"
46
+ module-name = "artifact_parser._native"
47
+ python-source = "src"
48
+ python-packages = ["artifact_parser", "codegen"]
46
49
 
47
- [tool.hatch.build.targets.wheel]
48
- packages = ["src/artifact_parser", "src/codegen"]
49
- artifacts = [
50
- "src/artifact_parser/py.typed",
51
- "src/artifact_parser/dbt/resources/**/*.json",
52
- "src/artifact_parser/dbt_info_schema/resources/*.json",
53
- "src/codegen/dbt/templates/*.jinja",
54
- ]
55
-
56
- [tool.hatch.build.targets.sdist]
57
- include = [
58
- "src/artifact_parser",
59
- "src/codegen",
60
- "README.md",
61
- "LICENSE",
50
+ [tool.uv]
51
+ cache-keys = [
52
+ { file = "pyproject.toml" },
53
+ { file = "rust/Cargo.toml" },
54
+ { file = "rust/src/**/*.rs" },
62
55
  ]
63
56
 
64
57
  [dependency-groups]
@@ -88,6 +81,7 @@ known-first-party = ["artifact_parser", "codegen"]
88
81
 
89
82
  [tool.pytest.ini_options]
90
83
  testpaths = ["tests"]
84
+ pythonpath = [".claude/hooks"]
91
85
  addopts = "-ra --strict-markers --strict-config"
92
86
 
93
87
  [tool.coverage.run]
@@ -0,0 +1,253 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "artifact-parser-native"
7
+ version = "2.0.0"
8
+ dependencies = [
9
+ "jiter",
10
+ "pyo3",
11
+ ]
12
+
13
+ [[package]]
14
+ name = "autocfg"
15
+ version = "1.5.1"
16
+ source = "registry+https://github.com/rust-lang/crates.io-index"
17
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
18
+
19
+ [[package]]
20
+ name = "bitvec"
21
+ version = "1.1.1"
22
+ source = "registry+https://github.com/rust-lang/crates.io-index"
23
+ checksum = "ddcec3d12c579d40898fe0a9a358a803c23e9c52ca3c425707f81c9436211837"
24
+ dependencies = [
25
+ "funty",
26
+ "radium",
27
+ "tap",
28
+ "wyz",
29
+ ]
30
+
31
+ [[package]]
32
+ name = "funty"
33
+ version = "2.0.0"
34
+ source = "registry+https://github.com/rust-lang/crates.io-index"
35
+ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
36
+
37
+ [[package]]
38
+ name = "heck"
39
+ version = "0.5.0"
40
+ source = "registry+https://github.com/rust-lang/crates.io-index"
41
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
42
+
43
+ [[package]]
44
+ name = "jiter"
45
+ version = "0.19.0"
46
+ source = "registry+https://github.com/rust-lang/crates.io-index"
47
+ checksum = "4027f86130c7a1997f880ed407580e58514b867af49e7ce44370f80fa6ff999f"
48
+ dependencies = [
49
+ "bitvec",
50
+ "lexical-parse-float",
51
+ "num-bigint",
52
+ "num-traits",
53
+ "pyo3",
54
+ "smallvec",
55
+ ]
56
+
57
+ [[package]]
58
+ name = "lexical-parse-float"
59
+ version = "1.0.6"
60
+ source = "registry+https://github.com/rust-lang/crates.io-index"
61
+ checksum = "52a9f232fbd6f550bc0137dcb5f99ab674071ac2d690ac69704593cb4abbea56"
62
+ dependencies = [
63
+ "lexical-parse-integer",
64
+ "lexical-util",
65
+ ]
66
+
67
+ [[package]]
68
+ name = "lexical-parse-integer"
69
+ version = "1.0.6"
70
+ source = "registry+https://github.com/rust-lang/crates.io-index"
71
+ checksum = "9a7a039f8fb9c19c996cd7b2fcce303c1b2874fe1aca544edc85c4a5f8489b34"
72
+ dependencies = [
73
+ "lexical-util",
74
+ ]
75
+
76
+ [[package]]
77
+ name = "lexical-util"
78
+ version = "1.0.7"
79
+ source = "registry+https://github.com/rust-lang/crates.io-index"
80
+ checksum = "2604dd126bb14f13fb5d1bd6a66155079cb9fa655b37f875b3a742c705dbed17"
81
+
82
+ [[package]]
83
+ name = "libc"
84
+ version = "0.2.191"
85
+ source = "registry+https://github.com/rust-lang/crates.io-index"
86
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
87
+
88
+ [[package]]
89
+ name = "num-bigint"
90
+ version = "0.4.8"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"
93
+ dependencies = [
94
+ "num-integer",
95
+ "num-traits",
96
+ ]
97
+
98
+ [[package]]
99
+ name = "num-integer"
100
+ version = "0.1.47"
101
+ source = "registry+https://github.com/rust-lang/crates.io-index"
102
+ checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
103
+ dependencies = [
104
+ "num-traits",
105
+ ]
106
+
107
+ [[package]]
108
+ name = "num-traits"
109
+ version = "0.2.19"
110
+ source = "registry+https://github.com/rust-lang/crates.io-index"
111
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
112
+ dependencies = [
113
+ "autocfg",
114
+ ]
115
+
116
+ [[package]]
117
+ name = "once_cell"
118
+ version = "1.21.4"
119
+ source = "registry+https://github.com/rust-lang/crates.io-index"
120
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
121
+
122
+ [[package]]
123
+ name = "portable-atomic"
124
+ version = "1.15.0"
125
+ source = "registry+https://github.com/rust-lang/crates.io-index"
126
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
127
+
128
+ [[package]]
129
+ name = "proc-macro2"
130
+ version = "1.0.107"
131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
132
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
133
+ dependencies = [
134
+ "unicode-ident",
135
+ ]
136
+
137
+ [[package]]
138
+ name = "pyo3"
139
+ version = "0.30.1"
140
+ source = "registry+https://github.com/rust-lang/crates.io-index"
141
+ checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
142
+ dependencies = [
143
+ "libc",
144
+ "num-bigint",
145
+ "num-traits",
146
+ "once_cell",
147
+ "portable-atomic",
148
+ "pyo3-build-config",
149
+ "pyo3-ffi",
150
+ "pyo3-macros",
151
+ ]
152
+
153
+ [[package]]
154
+ name = "pyo3-build-config"
155
+ version = "0.30.1"
156
+ source = "registry+https://github.com/rust-lang/crates.io-index"
157
+ checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
158
+ dependencies = [
159
+ "target-lexicon",
160
+ ]
161
+
162
+ [[package]]
163
+ name = "pyo3-ffi"
164
+ version = "0.30.1"
165
+ source = "registry+https://github.com/rust-lang/crates.io-index"
166
+ checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
167
+ dependencies = [
168
+ "libc",
169
+ "pyo3-build-config",
170
+ ]
171
+
172
+ [[package]]
173
+ name = "pyo3-macros"
174
+ version = "0.30.1"
175
+ source = "registry+https://github.com/rust-lang/crates.io-index"
176
+ checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
177
+ dependencies = [
178
+ "proc-macro2",
179
+ "pyo3-macros-backend",
180
+ "quote",
181
+ "syn",
182
+ ]
183
+
184
+ [[package]]
185
+ name = "pyo3-macros-backend"
186
+ version = "0.30.1"
187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
188
+ checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
189
+ dependencies = [
190
+ "heck",
191
+ "proc-macro2",
192
+ "quote",
193
+ "syn",
194
+ ]
195
+
196
+ [[package]]
197
+ name = "quote"
198
+ version = "1.0.47"
199
+ source = "registry+https://github.com/rust-lang/crates.io-index"
200
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
201
+ dependencies = [
202
+ "proc-macro2",
203
+ ]
204
+
205
+ [[package]]
206
+ name = "radium"
207
+ version = "0.7.0"
208
+ source = "registry+https://github.com/rust-lang/crates.io-index"
209
+ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
210
+
211
+ [[package]]
212
+ name = "smallvec"
213
+ version = "1.16.6"
214
+ source = "registry+https://github.com/rust-lang/crates.io-index"
215
+ checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59"
216
+
217
+ [[package]]
218
+ name = "syn"
219
+ version = "3.0.10"
220
+ source = "registry+https://github.com/rust-lang/crates.io-index"
221
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
222
+ dependencies = [
223
+ "proc-macro2",
224
+ "quote",
225
+ "unicode-ident",
226
+ ]
227
+
228
+ [[package]]
229
+ name = "tap"
230
+ version = "1.0.1"
231
+ source = "registry+https://github.com/rust-lang/crates.io-index"
232
+ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
233
+
234
+ [[package]]
235
+ name = "target-lexicon"
236
+ version = "0.13.6"
237
+ source = "registry+https://github.com/rust-lang/crates.io-index"
238
+ checksum = "8c447be3a2abfa84b2d91680c56600bd6b2873866de27b36ec911be705e291da"
239
+
240
+ [[package]]
241
+ name = "unicode-ident"
242
+ version = "1.0.27"
243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
244
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
245
+
246
+ [[package]]
247
+ name = "wyz"
248
+ version = "0.5.1"
249
+ source = "registry+https://github.com/rust-lang/crates.io-index"
250
+ checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
251
+ dependencies = [
252
+ "tap",
253
+ ]
@@ -0,0 +1,18 @@
1
+ [package]
2
+ name = "artifact-parser-native"
3
+ version = "2.0.0"
4
+ edition = "2024"
5
+ publish = false
6
+
7
+ [lib]
8
+ name = "_native"
9
+ crate-type = ["cdylib"]
10
+
11
+ [dependencies]
12
+ jiter = "0.19.0"
13
+ pyo3 = { version = "0.30.1", features = ["abi3-py310"] }
14
+
15
+ [profile.release]
16
+ lto = true
17
+ # Cargo's default stripping can misalign the binary, which macOS refuses to load.
18
+ strip = "none"
@@ -0,0 +1,37 @@
1
+ #[pyo3::pymodule]
2
+ mod _native {
3
+ use jiter::Jiter;
4
+ use pyo3::exceptions::PyValueError;
5
+ use pyo3::prelude::*;
6
+ use pyo3::types::PyDict;
7
+
8
+ fn invalid(error: impl std::fmt::Display) -> PyErr {
9
+ PyValueError::new_err(format!("Invalid JSON: {error}"))
10
+ }
11
+
12
+ /// Map each key of the JSON object at `data[start:end]` to its value's
13
+ /// `(start, end)` byte span, without building the values.
14
+ #[pyfunction]
15
+ fn index_object<'py>(
16
+ py: Python<'py>,
17
+ data: &[u8],
18
+ start: usize,
19
+ end: usize,
20
+ ) -> PyResult<Bound<'py, PyDict>> {
21
+ let object = data
22
+ .get(start..end)
23
+ .ok_or_else(|| invalid("span out of range"))?;
24
+ let mut json = Jiter::new(object).with_allow_inf_nan();
25
+ let spans = PyDict::new(py);
26
+ let mut key = json.next_object().map_err(invalid)?.map(str::to_owned);
27
+ while let Some(name) = key {
28
+ let value = json.peek().map_err(invalid)?;
29
+ let from = start + json.current_index();
30
+ json.known_skip(value).map_err(invalid)?;
31
+ spans.set_item(name, (from, start + json.current_index()))?;
32
+ key = json.next_key().map_err(invalid)?.map(str::to_owned);
33
+ }
34
+ json.finish().map_err(invalid)?;
35
+ Ok(spans)
36
+ }
37
+ }
@@ -32,10 +32,9 @@ from artifact_parser.core import registry
32
32
 
33
33
  try:
34
34
  importlib.import_module("artifact_parser.dbt") # registers the dbt plugin
35
- except ImportError: # pragma: no cover - only when dbt/generated/ is dropped
35
+ except ModuleNotFoundError as exc: # pragma: no cover - dbt/generated/ is dropped
36
36
  warnings.warn(
37
- "artifact_parser.dbt is unavailable (generated code missing). "
38
- "Run `codegen dbt` to rebuild it.",
37
+ f"artifact_parser.dbt is unavailable ({exc}). Run `uv sync` or `codegen dbt`.",
39
38
  stacklevel=2,
40
39
  )
41
40
 
@@ -0,0 +1 @@
1
+ def index_object(data: bytes, start: int, end: int) -> dict[str, tuple[int, int]]: ...
@@ -16,6 +16,8 @@ from artifact_parser.dbt.generated.parser import parse_catalog
16
16
  from artifact_parser.dbt.generated.parser import parse_manifest
17
17
  from artifact_parser.dbt.generated.parser import parse_run_results
18
18
  from artifact_parser.dbt.generated.parser import parse_sources
19
+ from artifact_parser.dbt.lazy_artifact import LazyArtifact
20
+ from artifact_parser.dbt.lazy_artifact import parse_file
19
21
  from artifact_parser.dbt.plugin import DbtArtifactParser
20
22
 
21
23
  dbt_parser = DbtArtifactParser()
@@ -23,8 +25,10 @@ registry.register(dbt_parser)
23
25
 
24
26
  __all__ = [
25
27
  "DbtArtifactParser",
28
+ "LazyArtifact",
26
29
  "dbt_parser",
27
30
  "parse_catalog",
31
+ "parse_file",
28
32
  "parse_manifest",
29
33
  "parse_run_results",
30
34
  "parse_sources",
@@ -7,6 +7,7 @@ from enum import Enum
7
7
  from typing import Any
8
8
 
9
9
  from artifact_parser.core.base import BaseArtifactModel
10
+ from artifact_parser.dbt.resource_union import ResourceUnion
10
11
  from pydantic import AwareDatetime, ConfigDict, Field, RootModel, constr
11
12
 
12
13
 
@@ -1422,22 +1423,24 @@ class ManifestV1(BaseArtifactModel):
1422
1423
  metadata: ManifestMetadata = Field(..., description="Metadata about the manifest")
1423
1424
  nodes: dict[
1424
1425
  str,
1425
- CompiledAnalysisNode
1426
- | CompiledDataTestNode
1427
- | CompiledModelNode
1428
- | CompiledHookNode
1429
- | CompiledRPCNode
1430
- | CompiledSchemaTestNode
1431
- | CompiledSeedNode
1432
- | CompiledSnapshotNode
1433
- | ParsedAnalysisNode
1434
- | ParsedDataTestNode
1435
- | ParsedHookNode
1436
- | ParsedModelNode
1437
- | ParsedRPCNode
1438
- | ParsedSchemaTestNode
1439
- | ParsedSeedNode
1440
- | ParsedSnapshotNode,
1426
+ ResourceUnion[
1427
+ CompiledAnalysisNode
1428
+ | CompiledDataTestNode
1429
+ | CompiledModelNode
1430
+ | CompiledHookNode
1431
+ | CompiledRPCNode
1432
+ | CompiledSchemaTestNode
1433
+ | CompiledSeedNode
1434
+ | CompiledSnapshotNode
1435
+ | ParsedAnalysisNode
1436
+ | ParsedDataTestNode
1437
+ | ParsedHookNode
1438
+ | ParsedModelNode
1439
+ | ParsedRPCNode
1440
+ | ParsedSchemaTestNode
1441
+ | ParsedSeedNode
1442
+ | ParsedSnapshotNode
1443
+ ],
1441
1444
  ] = Field(
1442
1445
  ..., description="The nodes defined in the dbt project and its dependencies"
1443
1446
  )
@@ -1458,23 +1461,25 @@ class ManifestV1(BaseArtifactModel):
1458
1461
  )
1459
1462
  disabled: (
1460
1463
  list[
1461
- CompiledAnalysisNode
1462
- | CompiledDataTestNode
1463
- | CompiledModelNode
1464
- | CompiledHookNode
1465
- | CompiledRPCNode
1466
- | CompiledSchemaTestNode
1467
- | CompiledSeedNode
1468
- | CompiledSnapshotNode
1469
- | ParsedAnalysisNode
1470
- | ParsedDataTestNode
1471
- | ParsedHookNode
1472
- | ParsedModelNode
1473
- | ParsedRPCNode
1474
- | ParsedSchemaTestNode
1475
- | ParsedSeedNode
1476
- | ParsedSnapshotNode
1477
- | ParsedSourceDefinition
1464
+ ResourceUnion[
1465
+ CompiledAnalysisNode
1466
+ | CompiledDataTestNode
1467
+ | CompiledModelNode
1468
+ | CompiledHookNode
1469
+ | CompiledRPCNode
1470
+ | CompiledSchemaTestNode
1471
+ | CompiledSeedNode
1472
+ | CompiledSnapshotNode
1473
+ | ParsedAnalysisNode
1474
+ | ParsedDataTestNode
1475
+ | ParsedHookNode
1476
+ | ParsedModelNode
1477
+ | ParsedRPCNode
1478
+ | ParsedSchemaTestNode
1479
+ | ParsedSeedNode
1480
+ | ParsedSnapshotNode
1481
+ | ParsedSourceDefinition
1482
+ ]
1478
1483
  ]
1479
1484
  | None
1480
1485
  ) = Field(None, description="A list of the disabled nodes in the target")