artifact-parser 1.0.1__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.
- artifact_parser-2.0.0/PKG-INFO +91 -0
- artifact_parser-2.0.0/README.md +61 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/pyproject.toml +19 -20
- artifact_parser-2.0.0/rust/Cargo.lock +253 -0
- artifact_parser-2.0.0/rust/Cargo.toml +18 -0
- artifact_parser-2.0.0/rust/src/lib.rs +37 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/__init__.py +12 -4
- artifact_parser-2.0.0/src/artifact_parser/_native.pyi +1 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/core/__init__.py +2 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/core/exceptions.py +4 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/__init__.py +4 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v1.py +38 -33
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v10.py +29 -23
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v11.py +30 -16
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v12.py +33 -19
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v2.py +38 -33
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v3.py +38 -33
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v4.py +42 -37
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v5.py +42 -37
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v6.py +42 -37
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v7.py +44 -38
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v8.py +26 -20
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/manifest_v9.py +28 -22
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/parser.py +64 -46
- artifact_parser-2.0.0/src/artifact_parser/dbt/generated/version_map.py +142 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt/known_or_text.py +23 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt/lazy_artifact.py +71 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt/lazy_section.py +35 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt/resource_union.py +55 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/utils.py +4 -3
- artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/__init__.py +43 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/base.py +51 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/generated/__init__.py +5 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/generated/models/info_schema_v1.py +951 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/loader.py +47 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/plugin.py +30 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/resources/info_schema_v1.json +2937 -0
- artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/utils.py +38 -0
- artifact_parser-2.0.0/src/artifact_parser/py.typed +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/cli.py +24 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/dbt/generator.py +38 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/dbt/templates/parser.py.jinja +10 -4
- artifact_parser-2.0.0/src/codegen/dbt/templates/version_map.py.jinja +39 -0
- artifact_parser-2.0.0/src/codegen/dbt_info_schema/__init__.py +1 -0
- artifact_parser-2.0.0/src/codegen/dbt_info_schema/generator.py +193 -0
- artifact_parser-1.0.1/.gitignore +0 -218
- artifact_parser-1.0.1/PKG-INFO +0 -196
- artifact_parser-1.0.1/README.md +0 -170
- artifact_parser-1.0.1/src/artifact_parser/dbt/generated/version_map.py +0 -112
- artifact_parser-1.0.1/src/codegen/dbt/templates/version_map.py.jinja +0 -31
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/LICENSE +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/core/base.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/core/parser.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/core/registry.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/catalog/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/catalog/catalog_v1.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/manifest/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v1.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v2.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v3.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v4.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v5.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/run_results/run_results_v6.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/sources/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/sources/sources_v1.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/sources/sources_v2.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/generated/models/sources/sources_v3.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/plugin.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/catalog/catalog_v1.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v1.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v10.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v11.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v12.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v2.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v3.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v4.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v5.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v6.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v7.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v8.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/manifest/manifest_v9.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v1.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v2.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v3.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v4.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v5.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/run-results/run-results_v6.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/sources/sources_v1.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/sources/sources_v2.json +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/artifact_parser/dbt/resources/sources/sources_v3.json +0 -0
- /artifact_parser-1.0.1/src/artifact_parser/py.typed → /artifact_parser-2.0.0/src/artifact_parser/dbt_info_schema/generated/models/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/__main__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/dbt/__init__.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/dbt/artifact_spec.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/dbt/paths.py +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/dbt/templates/generated_init.py.jinja +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/dbt/templates/versions.py.jinja +0 -0
- {artifact_parser-1.0.1 → artifact_parser-2.0.0}/src/codegen/dbt/versions.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
|
+
[](https://pypi.org/project/artifact-parser/)
|
|
39
|
+

|
|
40
|
+
[](https://opensource.org/licenses/MIT)
|
|
41
|
+
[](https://www.python.org)
|
|
42
|
+
[](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml)
|
|
43
|
+
[](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml)
|
|
44
|
+
|
|
45
|
+
[](https://github.com/datnguye/artifact-parser)
|
|
46
|
+
[](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
|
+
[](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
|
+
[](https://pypi.org/project/artifact-parser/)
|
|
10
|
+

|
|
11
|
+
[](https://opensource.org/licenses/MIT)
|
|
12
|
+
[](https://www.python.org)
|
|
13
|
+
[](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml)
|
|
14
|
+
[](https://github.com/datnguye/artifact-parser/actions/workflows/ci.yml)
|
|
15
|
+
|
|
16
|
+
[](https://github.com/datnguye/artifact-parser)
|
|
17
|
+
[](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
|
+
[](https://www.buymeacoffee.com/datnguye)
|
|
@@ -17,15 +17,17 @@ classifiers = [
|
|
|
17
17
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
18
18
|
]
|
|
19
19
|
dependencies = [
|
|
20
|
-
"pydantic>=2.
|
|
20
|
+
"pydantic>=2.2",
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
[project.optional-dependencies]
|
|
24
24
|
dbt = []
|
|
25
|
+
info-schema = ["pyarrow>=15"]
|
|
25
26
|
codegen = [
|
|
26
27
|
"datamodel-code-generator>=0.63.0",
|
|
27
28
|
"jinja2>=3.1",
|
|
28
29
|
"typer>=0.26.7",
|
|
30
|
+
"pyarrow>=15",
|
|
29
31
|
]
|
|
30
32
|
|
|
31
33
|
[project.scripts]
|
|
@@ -36,31 +38,25 @@ Homepage = "https://github.com/datnguye/artifact-parser"
|
|
|
36
38
|
Repository = "https://github.com/datnguye/artifact-parser"
|
|
37
39
|
|
|
38
40
|
[build-system]
|
|
39
|
-
requires = ["
|
|
40
|
-
build-backend = "
|
|
41
|
+
requires = ["maturin>=1.9,<2"]
|
|
42
|
+
build-backend = "maturin"
|
|
41
43
|
|
|
42
|
-
[tool.
|
|
43
|
-
|
|
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"]
|
|
44
49
|
|
|
45
|
-
[tool.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"src
|
|
50
|
-
"src/codegen/dbt/templates/*.jinja",
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
[tool.hatch.build.targets.sdist]
|
|
54
|
-
include = [
|
|
55
|
-
"src/artifact_parser",
|
|
56
|
-
"src/codegen",
|
|
57
|
-
"README.md",
|
|
58
|
-
"LICENSE",
|
|
50
|
+
[tool.uv]
|
|
51
|
+
cache-keys = [
|
|
52
|
+
{ file = "pyproject.toml" },
|
|
53
|
+
{ file = "rust/Cargo.toml" },
|
|
54
|
+
{ file = "rust/src/**/*.rs" },
|
|
59
55
|
]
|
|
60
56
|
|
|
61
57
|
[dependency-groups]
|
|
62
58
|
dev = [
|
|
63
|
-
"artifact-parser[codegen,dbt]",
|
|
59
|
+
"artifact-parser[codegen,dbt,info-schema]",
|
|
64
60
|
"pre-commit>=4.6.0",
|
|
65
61
|
"pytest>=8.0",
|
|
66
62
|
"pytest-cov>=5.0",
|
|
@@ -79,11 +75,13 @@ force-single-line = true
|
|
|
79
75
|
known-first-party = ["artifact_parser", "codegen"]
|
|
80
76
|
|
|
81
77
|
[tool.ruff.lint.per-file-ignores]
|
|
78
|
+
"src/artifact_parser/dbt_info_schema/generated/**/*.py" = ["E501", "I", "UP", "B", "SIM"]
|
|
82
79
|
"src/artifact_parser/dbt/generated/**/*.py" = ["E501", "I", "UP", "B", "SIM"]
|
|
83
80
|
"src/codegen/cli.py" = ["B008"]
|
|
84
81
|
|
|
85
82
|
[tool.pytest.ini_options]
|
|
86
83
|
testpaths = ["tests"]
|
|
84
|
+
pythonpath = [".claude/hooks"]
|
|
87
85
|
addopts = "-ra --strict-markers --strict-config"
|
|
88
86
|
|
|
89
87
|
[tool.coverage.run]
|
|
@@ -92,6 +90,7 @@ branch = true
|
|
|
92
90
|
omit = [
|
|
93
91
|
"src/artifact_parser/dbt/generated/*.py",
|
|
94
92
|
"src/artifact_parser/dbt/generated/models/*/*.py",
|
|
93
|
+
"src/artifact_parser/dbt_info_schema/generated/models/*.py",
|
|
95
94
|
"src/codegen/__main__.py",
|
|
96
95
|
]
|
|
97
96
|
|
|
@@ -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
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The framework is source-agnostic: each plugin owns one family of artifacts and
|
|
4
4
|
registers itself with the shared :data:`~artifact_parser.core.registry.registry`.
|
|
5
|
-
|
|
5
|
+
Plugins parse dbt-core artifacts and dbt 2.0's parquet info schema.
|
|
6
6
|
|
|
7
7
|
The headline entry point is :func:`parse`, which sniffs any supported artifact
|
|
8
8
|
and routes it to the right plugin::
|
|
@@ -32,10 +32,18 @@ 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
|
|
35
|
+
except ModuleNotFoundError as exc: # pragma: no cover - dbt/generated/ is dropped
|
|
36
36
|
warnings.warn(
|
|
37
|
-
"artifact_parser.dbt is unavailable (
|
|
38
|
-
|
|
37
|
+
f"artifact_parser.dbt is unavailable ({exc}). Run `uv sync` or `codegen dbt`.",
|
|
38
|
+
stacklevel=2,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
try:
|
|
42
|
+
importlib.import_module("artifact_parser.dbt_info_schema") # registers parquet
|
|
43
|
+
except ImportError: # pragma: no cover - only when its generated/ is dropped
|
|
44
|
+
warnings.warn(
|
|
45
|
+
"artifact_parser.dbt_info_schema is unavailable (generated code missing). "
|
|
46
|
+
"Run `codegen dbt-info-schema` to rebuild it.",
|
|
39
47
|
stacklevel=2,
|
|
40
48
|
)
|
|
41
49
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
def index_object(data: bytes, start: int, end: int) -> dict[str, tuple[int, int]]: ...
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from artifact_parser.core.base import BaseArtifactModel
|
|
4
4
|
from artifact_parser.core.exceptions import ArtifactParserError
|
|
5
|
+
from artifact_parser.core.exceptions import OptionalDependencyError
|
|
5
6
|
from artifact_parser.core.exceptions import ParserRegistrationError
|
|
6
7
|
from artifact_parser.core.exceptions import UnknownArtifactError
|
|
7
8
|
from artifact_parser.core.parser import ArtifactParser
|
|
@@ -12,6 +13,7 @@ __all__ = [
|
|
|
12
13
|
"ArtifactParser",
|
|
13
14
|
"ArtifactParserError",
|
|
14
15
|
"BaseArtifactModel",
|
|
16
|
+
"OptionalDependencyError",
|
|
15
17
|
"ParserRegistrationError",
|
|
16
18
|
"ParserRegistry",
|
|
17
19
|
"UnknownArtifactError",
|
|
@@ -11,3 +11,7 @@ class UnknownArtifactError(ArtifactParserError):
|
|
|
11
11
|
|
|
12
12
|
class ParserRegistrationError(ArtifactParserError):
|
|
13
13
|
"""Raised when a parser is registered under a name that is already taken."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class OptionalDependencyError(ArtifactParserError):
|
|
17
|
+
"""Raised when a feature needs an optional extra that is not installed."""
|
|
@@ -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",
|