model2data 0.1.0__tar.gz → 0.2.1__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.
- {model2data-0.1.0 → model2data-0.2.1}/PKG-INFO +10 -3
- {model2data-0.1.0 → model2data-0.2.1}/README.md +2 -2
- model2data-0.2.1/model2data/__init__.py +3 -0
- {model2data-0.1.0 → model2data-0.2.1}/model2data/cli.py +7 -18
- {model2data-0.1.0 → model2data-0.2.1}/model2data/utils.py +2 -1
- {model2data-0.1.0 → model2data-0.2.1}/model2data.egg-info/PKG-INFO +10 -3
- {model2data-0.1.0 → model2data-0.2.1}/model2data.egg-info/SOURCES.txt +4 -6
- {model2data-0.1.0 → model2data-0.2.1}/model2data.egg-info/requires.txt +7 -0
- model2data-0.2.1/pyproject.toml +74 -0
- model2data-0.2.1/tests/test_cli.py +493 -0
- model2data-0.2.1/tests/test_coverage_gaps.py +233 -0
- model2data-0.2.1/tests/test_dbml_parser.py +929 -0
- model2data-0.2.1/tests/test_dbt_project.py +276 -0
- model2data-0.2.1/tests/test_dbt_tests.py +63 -0
- model2data-0.2.1/tests/test_generation.py +367 -0
- model2data-0.1.0/model2data/dbt/project.py +0 -74
- model2data-0.1.0/model2data/generate/core.py +0 -171
- model2data-0.1.0/model2data/generate/faker.py +0 -113
- model2data-0.1.0/model2data/generate/relationships.py +0 -49
- model2data-0.1.0/model2data/parse/dbml.py +0 -162
- model2data-0.1.0/pyproject.toml +0 -31
- model2data-0.1.0/tests/test_cli_smoke.py +0 -41
- model2data-0.1.0/tests/test_dbml_parser.py +0 -29
- model2data-0.1.0/tests/test_dbt_tests.py +0 -31
- model2data-0.1.0/tests/test_generation.py +0 -47
- {model2data-0.1.0 → model2data-0.2.1}/LICENSE +0 -0
- {model2data-0.1.0 → model2data-0.2.1}/model2data.egg-info/dependency_links.txt +0 -0
- {model2data-0.1.0 → model2data-0.2.1}/model2data.egg-info/entry_points.txt +0 -0
- {model2data-0.1.0 → model2data-0.2.1}/model2data.egg-info/top_level.txt +0 -0
- {model2data-0.1.0 → model2data-0.2.1}/setup.cfg +0 -0
- {model2data-0.1.0 → model2data-0.2.1}/tests/test_dbt_naming.py +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: model2data
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Generate analytics-ready datasets from DBML models
|
|
5
|
-
Requires-Python: >=3.
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Requires-Dist: dbt-core>=1.5.0
|
|
@@ -13,6 +13,13 @@ Requires-Dist: pyyaml>=6.0.3
|
|
|
13
13
|
Requires-Dist: typer>=0.20.0
|
|
14
14
|
Provides-Extra: dev
|
|
15
15
|
Requires-Dist: pytest; extra == "dev"
|
|
16
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
17
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
18
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
19
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
20
|
+
Requires-Dist: ty>=0.0.4; extra == "dev"
|
|
21
|
+
Requires-Dist: types-pyyaml; extra == "dev"
|
|
22
|
+
Requires-Dist: poethepoet>=0.38.0; extra == "dev"
|
|
16
23
|
Dynamic: license-file
|
|
17
24
|
|
|
18
25
|
# model2data
|
|
@@ -22,7 +29,7 @@ Dynamic: license-file
|
|
|
22
29
|
[](https://codecov.io/gh/JB-Analytica/model2data)
|
|
23
30
|
[](LICENSE)
|
|
24
31
|
|
|
25
|
-
`model2data` turns **data models into analytics-ready datasets** in seconds.
|
|
32
|
+
`model2data` turns **data models into analytics-ready datasets** in seconds.
|
|
26
33
|
|
|
27
34
|
Given a **DBML file**, it generates synthetic but realistic data, a complete dbt project scaffold, and everything you need to start analyzing or testing data pipelines.
|
|
28
35
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://codecov.io/gh/JB-Analytica/model2data)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
`model2data` turns **data models into analytics-ready datasets** in seconds.
|
|
8
|
+
`model2data` turns **data models into analytics-ready datasets** in seconds.
|
|
9
9
|
|
|
10
10
|
Given a **DBML file**, it generates synthetic but realistic data, a complete dbt project scaffold, and everything you need to start analyzing or testing data pipelines.
|
|
11
11
|
|
|
@@ -134,4 +134,4 @@ Please read our [Code of Conduct](CODE_OF_CONDUCT.md) to understand our communit
|
|
|
134
134
|
|
|
135
135
|
## License
|
|
136
136
|
|
|
137
|
-
MIT License. See LICENSE for details.
|
|
137
|
+
MIT License. See LICENSE for details.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
from typing import Optional
|
|
3
1
|
import random
|
|
4
2
|
import shutil
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Optional
|
|
5
5
|
|
|
6
6
|
import typer
|
|
7
7
|
from faker import Faker
|
|
8
8
|
|
|
9
|
-
from model2data.parse.dbml import parse_dbml
|
|
10
|
-
from model2data.generate.core import generate_data_from_dbml
|
|
11
9
|
from model2data.dbt.project import (
|
|
12
|
-
create_project_scaffold,
|
|
13
10
|
create_profiles_yml,
|
|
11
|
+
create_project_scaffold,
|
|
14
12
|
create_staging_models,
|
|
15
13
|
)
|
|
16
14
|
from model2data.dbt.tests import generate_dbt_yml
|
|
15
|
+
from model2data.generate.core import generate_data_from_dbml
|
|
16
|
+
from model2data.parse.dbml import parse_dbml
|
|
17
17
|
from model2data.utils import normalize_identifier
|
|
18
18
|
|
|
19
19
|
app = typer.Typer(
|
|
@@ -30,7 +30,7 @@ app = typer.Typer(
|
|
|
30
30
|
|
|
31
31
|
@app.command(help="Generate synthetic data and a dbt project from a DBML model.")
|
|
32
32
|
def main(
|
|
33
|
-
file: Path = typer.Option(
|
|
33
|
+
file: Path = typer.Option( # noqa: B008
|
|
34
34
|
...,
|
|
35
35
|
"--file",
|
|
36
36
|
"-f",
|
|
@@ -88,24 +88,13 @@ def main(
|
|
|
88
88
|
typer.echo("❌ No tables found in the provided DBML file.")
|
|
89
89
|
raise typer.Exit(1)
|
|
90
90
|
|
|
91
|
-
# -------------------------
|
|
92
|
-
# DBML → dbt name mapping
|
|
93
|
-
# -------------------------
|
|
94
|
-
dbt_name_map = {
|
|
95
|
-
table_name: normalize_identifier(table_name)
|
|
96
|
-
for table_name in tables.keys()
|
|
97
|
-
}
|
|
98
|
-
|
|
99
91
|
project_name = normalize_identifier(name or file.stem)
|
|
100
92
|
dest = Path.cwd() / f"dbt_{project_name}"
|
|
101
93
|
profile_name = f"{project_name}_profile"
|
|
102
94
|
|
|
103
95
|
if dest.exists():
|
|
104
96
|
if not force:
|
|
105
|
-
typer.echo(
|
|
106
|
-
f"❌ Destination {dest} already exists.\n"
|
|
107
|
-
"Use --force to overwrite."
|
|
108
|
-
)
|
|
97
|
+
typer.echo(f"❌ Destination {dest} already exists.\nUse --force to overwrite.")
|
|
109
98
|
raise typer.Exit(1)
|
|
110
99
|
shutil.rmtree(dest)
|
|
111
100
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: model2data
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Generate analytics-ready datasets from DBML models
|
|
5
|
-
Requires-Python: >=3.
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Requires-Dist: dbt-core>=1.5.0
|
|
@@ -13,6 +13,13 @@ Requires-Dist: pyyaml>=6.0.3
|
|
|
13
13
|
Requires-Dist: typer>=0.20.0
|
|
14
14
|
Provides-Extra: dev
|
|
15
15
|
Requires-Dist: pytest; extra == "dev"
|
|
16
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
17
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
18
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
19
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
20
|
+
Requires-Dist: ty>=0.0.4; extra == "dev"
|
|
21
|
+
Requires-Dist: types-pyyaml; extra == "dev"
|
|
22
|
+
Requires-Dist: poethepoet>=0.38.0; extra == "dev"
|
|
16
23
|
Dynamic: license-file
|
|
17
24
|
|
|
18
25
|
# model2data
|
|
@@ -22,7 +29,7 @@ Dynamic: license-file
|
|
|
22
29
|
[](https://codecov.io/gh/JB-Analytica/model2data)
|
|
23
30
|
[](LICENSE)
|
|
24
31
|
|
|
25
|
-
`model2data` turns **data models into analytics-ready datasets** in seconds.
|
|
32
|
+
`model2data` turns **data models into analytics-ready datasets** in seconds.
|
|
26
33
|
|
|
27
34
|
Given a **DBML file**, it generates synthetic but realistic data, a complete dbt project scaffold, and everything you need to start analyzing or testing data pipelines.
|
|
28
35
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
README.md
|
|
3
3
|
pyproject.toml
|
|
4
|
+
model2data/__init__.py
|
|
4
5
|
model2data/cli.py
|
|
5
6
|
model2data/utils.py
|
|
6
7
|
model2data.egg-info/PKG-INFO
|
|
@@ -9,13 +10,10 @@ model2data.egg-info/dependency_links.txt
|
|
|
9
10
|
model2data.egg-info/entry_points.txt
|
|
10
11
|
model2data.egg-info/requires.txt
|
|
11
12
|
model2data.egg-info/top_level.txt
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
model2data/generate/faker.py
|
|
15
|
-
model2data/generate/relationships.py
|
|
16
|
-
model2data/parse/dbml.py
|
|
17
|
-
tests/test_cli_smoke.py
|
|
13
|
+
tests/test_cli.py
|
|
14
|
+
tests/test_coverage_gaps.py
|
|
18
15
|
tests/test_dbml_parser.py
|
|
19
16
|
tests/test_dbt_naming.py
|
|
17
|
+
tests/test_dbt_project.py
|
|
20
18
|
tests/test_dbt_tests.py
|
|
21
19
|
tests/test_generation.py
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "model2data"
|
|
7
|
+
version = "0.2.1"
|
|
8
|
+
description = "Generate analytics-ready datasets from DBML models"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"dbt-core>=1.5.0",
|
|
13
|
+
"dbt-duckdb>=1.5.0",
|
|
14
|
+
"faker>=37.12.0",
|
|
15
|
+
"pandas>=2.3.3",
|
|
16
|
+
"pyyaml>=6.0.3",
|
|
17
|
+
"typer>=0.20.0",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.optional-dependencies]
|
|
21
|
+
dev = [
|
|
22
|
+
"pytest",
|
|
23
|
+
"pytest-cov",
|
|
24
|
+
"pre-commit",
|
|
25
|
+
"ruff>=0.1.0",
|
|
26
|
+
"black>=23.0.0",
|
|
27
|
+
"ty>=0.0.4",
|
|
28
|
+
"types-pyyaml",
|
|
29
|
+
"poethepoet>=0.38.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
model2data = "model2data.cli:app"
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
include = ["model2data"]
|
|
37
|
+
|
|
38
|
+
# Ruff configuration (fast Python linter)
|
|
39
|
+
[tool.ruff]
|
|
40
|
+
target-version = "py39"
|
|
41
|
+
line-length = 100
|
|
42
|
+
|
|
43
|
+
[tool.ruff.lint]
|
|
44
|
+
select = [
|
|
45
|
+
"E", # pycodestyle errors
|
|
46
|
+
"W", # pycodestyle warnings
|
|
47
|
+
"F", # pyflakes
|
|
48
|
+
"I", # isort (import sorting)
|
|
49
|
+
"C", # flake8-comprehensions
|
|
50
|
+
"B", # flake8-bugbear
|
|
51
|
+
]
|
|
52
|
+
ignore = [
|
|
53
|
+
"E501", # line too long (handled by black)
|
|
54
|
+
"C901", # complexity (handled with noqa when needed)
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[tool.ruff.lint.isort]
|
|
58
|
+
known-first-party = ["model2data"]
|
|
59
|
+
|
|
60
|
+
# Black configuration (code formatter)
|
|
61
|
+
[tool.black]
|
|
62
|
+
line-length = 100
|
|
63
|
+
target-version = ["py310", "py311", "py312"]
|
|
64
|
+
|
|
65
|
+
# ty configuration (type checker)
|
|
66
|
+
[tool.ty]
|
|
67
|
+
|
|
68
|
+
# Poe the Poet task runner
|
|
69
|
+
[tool.poe.tasks]
|
|
70
|
+
lint = "ruff check ."
|
|
71
|
+
fix = "ruff check . --fix --exit-zero"
|
|
72
|
+
type = "ty check"
|
|
73
|
+
test-quick = "pytest -q --no-header -p no:warnings --no-cov"
|
|
74
|
+
check = ["fix", "lint", "type", "test-quick"]
|