sql-lineage-extractor 0.1.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.
Files changed (75) hide show
  1. sql_lineage_extractor-0.1.1/.claude/settings.json +75 -0
  2. sql_lineage_extractor-0.1.1/.github/workflows/ci.yml +75 -0
  3. sql_lineage_extractor-0.1.1/.github/workflows/release.yml +52 -0
  4. sql_lineage_extractor-0.1.1/.gitignore +35 -0
  5. sql_lineage_extractor-0.1.1/CHANGELOG.md +83 -0
  6. sql_lineage_extractor-0.1.1/CONTRIBUTING.md +64 -0
  7. sql_lineage_extractor-0.1.1/LICENSE +201 -0
  8. sql_lineage_extractor-0.1.1/NOTICE +13 -0
  9. sql_lineage_extractor-0.1.1/PKG-INFO +351 -0
  10. sql_lineage_extractor-0.1.1/README.md +311 -0
  11. sql_lineage_extractor-0.1.1/docs/FABRIC_USAGE.md +111 -0
  12. sql_lineage_extractor-0.1.1/docs/MANIFEST_SCHEMA.md +63 -0
  13. sql_lineage_extractor-0.1.1/docs/ROADMAP_STANDALONE.md +176 -0
  14. sql_lineage_extractor-0.1.1/examples/00_Silver_Ipaki.ipynb +1672 -0
  15. sql_lineage_extractor-0.1.1/examples/00_Silver_Ipaki_v2.ipynb +346 -0
  16. sql_lineage_extractor-0.1.1/examples/01_Test_Lineage_Ipaki.ipynb +161 -0
  17. sql_lineage_extractor-0.1.1/examples/fabric_orchestration.py +82 -0
  18. sql_lineage_extractor-0.1.1/examples/prototypes/demo_sqlglot_lineage.py +57 -0
  19. sql_lineage_extractor-0.1.1/examples/prototypes/prototype_marimo_lineage.py +93 -0
  20. sql_lineage_extractor-0.1.1/pyproject.toml +104 -0
  21. sql_lineage_extractor-0.1.1/setup.cfg +4 -0
  22. sql_lineage_extractor-0.1.1/src/sql_lineage/__init__.py +30 -0
  23. sql_lineage_extractor-0.1.1/src/sql_lineage/_version.py +24 -0
  24. sql_lineage_extractor-0.1.1/src/sql_lineage/cli.py +217 -0
  25. sql_lineage_extractor-0.1.1/src/sql_lineage/config.py +145 -0
  26. sql_lineage_extractor-0.1.1/src/sql_lineage/export/__init__.py +29 -0
  27. sql_lineage_extractor-0.1.1/src/sql_lineage/export/backends.py +122 -0
  28. sql_lineage_extractor-0.1.1/src/sql_lineage/export/tables.py +179 -0
  29. sql_lineage_extractor-0.1.1/src/sql_lineage/graph/__init__.py +3 -0
  30. sql_lineage_extractor-0.1.1/src/sql_lineage/graph/builder.py +49 -0
  31. sql_lineage_extractor-0.1.1/src/sql_lineage/manifest/__init__.py +17 -0
  32. sql_lineage_extractor-0.1.1/src/sql_lineage/manifest/schema.json +73 -0
  33. sql_lineage_extractor-0.1.1/src/sql_lineage/manifest/writer.py +95 -0
  34. sql_lineage_extractor-0.1.1/src/sql_lineage/models.py +71 -0
  35. sql_lineage_extractor-0.1.1/src/sql_lineage/parsing/__init__.py +4 -0
  36. sql_lineage_extractor-0.1.1/src/sql_lineage/parsing/engine.py +166 -0
  37. sql_lineage_extractor-0.1.1/src/sql_lineage/parsing/lineage_extractor.py +53 -0
  38. sql_lineage_extractor-0.1.1/src/sql_lineage/pipeline.py +27 -0
  39. sql_lineage_extractor-0.1.1/src/sql_lineage/py.typed +0 -0
  40. sql_lineage_extractor-0.1.1/src/sql_lineage/sources/__init__.py +13 -0
  41. sql_lineage_extractor-0.1.1/src/sql_lineage/sources/base.py +14 -0
  42. sql_lineage_extractor-0.1.1/src/sql_lineage/sources/file_source.py +53 -0
  43. sql_lineage_extractor-0.1.1/src/sql_lineage/sources/live_sql_source.py +81 -0
  44. sql_lineage_extractor-0.1.1/src/sql_lineage/sources/notebook_source.py +261 -0
  45. sql_lineage_extractor-0.1.1/src/sql_lineage_extractor.egg-info/PKG-INFO +351 -0
  46. sql_lineage_extractor-0.1.1/src/sql_lineage_extractor.egg-info/SOURCES.txt +73 -0
  47. sql_lineage_extractor-0.1.1/src/sql_lineage_extractor.egg-info/dependency_links.txt +1 -0
  48. sql_lineage_extractor-0.1.1/src/sql_lineage_extractor.egg-info/entry_points.txt +2 -0
  49. sql_lineage_extractor-0.1.1/src/sql_lineage_extractor.egg-info/requires.txt +16 -0
  50. sql_lineage_extractor-0.1.1/src/sql_lineage_extractor.egg-info/scm_file_list.json +68 -0
  51. sql_lineage_extractor-0.1.1/src/sql_lineage_extractor.egg-info/scm_version.json +8 -0
  52. sql_lineage_extractor-0.1.1/src/sql_lineage_extractor.egg-info/top_level.txt +1 -0
  53. sql_lineage_extractor-0.1.1/tests/conftest.py +25 -0
  54. sql_lineage_extractor-0.1.1/tests/fixtures/golden/manifest_sql_chain.json +92 -0
  55. sql_lineage_extractor-0.1.1/tests/fixtures/notebooks/shipping_notebook.ipynb +62 -0
  56. sql_lineage_extractor-0.1.1/tests/fixtures/sql/calc_no_alias.sql +3 -0
  57. sql_lineage_extractor-0.1.1/tests/fixtures/sql/cte.sql +10 -0
  58. sql_lineage_extractor-0.1.1/tests/fixtures/sql/escale.sql +10 -0
  59. sql_lineage_extractor-0.1.1/tests/fixtures/sql/simple.sql +4 -0
  60. sql_lineage_extractor-0.1.1/tests/fixtures/sql/star.sql +1 -0
  61. sql_lineage_extractor-0.1.1/tests/fixtures/sql_chain/bronze_escale.sql +5 -0
  62. sql_lineage_extractor-0.1.1/tests/fixtures/sql_chain/gold_escale.sql +5 -0
  63. sql_lineage_extractor-0.1.1/tests/fixtures/sql_chain/silver_escale.sql +5 -0
  64. sql_lineage_extractor-0.1.1/tests/test_cli.py +56 -0
  65. sql_lineage_extractor-0.1.1/tests/test_config.py +185 -0
  66. sql_lineage_extractor-0.1.1/tests/test_export_backends.py +120 -0
  67. sql_lineage_extractor-0.1.1/tests/test_export_tables.py +78 -0
  68. sql_lineage_extractor-0.1.1/tests/test_file_source.py +25 -0
  69. sql_lineage_extractor-0.1.1/tests/test_golden_manifest.py +64 -0
  70. sql_lineage_extractor-0.1.1/tests/test_graph_builder.py +40 -0
  71. sql_lineage_extractor-0.1.1/tests/test_lineage_extractor.py +90 -0
  72. sql_lineage_extractor-0.1.1/tests/test_live_sql_source.py +58 -0
  73. sql_lineage_extractor-0.1.1/tests/test_manifest_schema.py +62 -0
  74. sql_lineage_extractor-0.1.1/tests/test_notebook_source.py +47 -0
  75. sql_lineage_extractor-0.1.1/tests/test_phase3_robustness.py +138 -0
@@ -0,0 +1,75 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "PowerShell(& \"c:\\\\Users\\\\e-jeffrey.yapi\\\\Downloads\\\\repo\\\\py-lineage\\\\.venv\\\\Scripts\\\\python.exe\" -m pip --version)",
5
+ "Bash(.venv/Scripts/python.exe -m pip install pytest)",
6
+ "Bash(.venv/Scripts/python.exe -m pytest -q)",
7
+ "Bash(.venv/Scripts/sql-lineage.exe extract *)",
8
+ "Bash(.venv/Scripts/python.exe -c \"import json; m=json.load\\(open\\('/tmp/demo_manifest.json'\\)\\); print\\(json.dumps\\({'escale': m['nodes']['escale'], 'errors': m['errors']}, indent=2, ensure_ascii=False\\)\\)\")",
9
+ "Bash(.venv/Scripts/python.exe -m sql_lineage.cli extract --source files --path tests/fixtures/sql --dialect tsql --out /tmp/demo_manifest.json)",
10
+ "Bash(rm -rf _demo)",
11
+ "Bash(mkdir _demo)",
12
+ "Bash(.venv/Scripts/python.exe -m sql_lineage.cli extract --source files --path tests/fixtures/sql_chain --dialect tsql --out _demo/manifest.json)",
13
+ "Bash(.venv/Scripts/python.exe -m sql_lineage.cli export _demo/manifest.json --format sqlite --out _demo/lineage.db)",
14
+ "Bash(.venv/Scripts/python.exe -c \"import sqlite3; c=sqlite3.connect\\('_demo/lineage.db'\\); [print\\(r\\) for r in c.execute\\('SELECT ancestor_node, descendant_node, depth FROM closure ORDER BY ancestor_node, depth'\\)]\")",
15
+ "Bash(rtk ls *)",
16
+ "Bash(rtk find *)",
17
+ "Bash(python -c ' *)",
18
+ "Bash(rtk read *)",
19
+ "Bash(.venv/Scripts/python.exe -c ' *)",
20
+ "Bash(.venv/Scripts/python.exe -c \"import sql_lineage; print\\('installed at', sql_lineage.__file__\\)\")",
21
+ "Bash(.venv/Scripts/python.exe \"C:\\\\Users\\\\E-JEFF~1.YAP\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage\\\\1a12472a-8ff0-46e6-a119-590cdf9329aa\\\\scratchpad\\\\build_test_nb.py\")",
22
+ "Bash(.venv/Scripts/python.exe -c \"import jupyter_client, nbconvert; print\\('nbconvert dispo'\\)\")",
23
+ "Bash(.venv/Scripts/python.exe -m jupyter nbconvert --to notebook --execute --stdout examples/01_Test_Lineage_Ipaki.ipynb)",
24
+ "Bash(../.venv/Scripts/python.exe -c ' *)",
25
+ "Bash(.venv/Scripts/python.exe -c \"import json; json.load\\(open\\('examples/01_Test_Lineage_Ipaki.ipynb',encoding='utf-8'\\)\\); print\\('JSON valide, nbformat OK'\\)\")",
26
+ "Bash(.venv/Scripts/python.exe \"C:\\\\Users\\\\E-JEFF~1.YAP\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage\\\\1a12472a-8ff0-46e6-a119-590cdf9329aa\\\\scratchpad\\\\probe.py\")",
27
+ "Bash(.venv/Scripts/python.exe \"C:\\\\Users\\\\E-JEFF~1.YAP\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage\\\\1a12472a-8ff0-46e6-a119-590cdf9329aa\\\\scratchpad\\\\gen_v2.py\")",
28
+ "Bash(.venv/Scripts/python.exe \"C:\\\\Users\\\\E-JEFF~1.YAP\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage\\\\1a12472a-8ff0-46e6-a119-590cdf9329aa\\\\scratchpad\\\\validate_v2.py\")",
29
+ "Bash(rtk curl *)",
30
+ "Bash(.venv/Scripts/python.exe -c \"import build,setuptools_scm; print\\('build+scm OK'\\)\")",
31
+ "Bash(mkdir -p examples/prototypes)",
32
+ "Bash(mv demo_sqlglot_lineage.py examples/prototypes/)",
33
+ "Bash(mv test-py-lineage.py examples/prototypes/prototype_marimo_lineage.py)",
34
+ "Bash(.venv/Scripts/python.exe -m pip install -q build \"setuptools>=77\" \"setuptools-scm>=8\")",
35
+ "Bash(.venv/Scripts/python.exe -c \"import build,setuptools,setuptools_scm; print\\('build',build.__version__,'| setuptools',setuptools.__version__,'| scm',setuptools_scm.__version__\\)\")",
36
+ "Bash(.venv/Scripts/python.exe -c \"import build,setuptools; from importlib.metadata import version; print\\('build',build.__version__,'| setuptools',setuptools.__version__,'| setuptools-scm',version\\('setuptools-scm'\\)\\)\")",
37
+ "Bash(git init *)",
38
+ "Bash(git symbolic-ref *)",
39
+ "Bash(git config *)",
40
+ "Bash(rtk git *)",
41
+ "Bash(rtk git commit -q -m 'chore: bootstrap standalone packaging \\(Phase 1\\) *)",
42
+ "Bash(git tag *)",
43
+ "Bash(.venv/Scripts/python.exe -m setuptools_scm)",
44
+ "Bash(.venv/Scripts/python.exe -m build)",
45
+ "Bash(C:/Users/e-jeffrey.yapi/AppData/Local/Temp/claude/c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage/1a12472a-8ff0-46e6-a119-590cdf9329aa/scratchpad/venv_test/Scripts/python.exe -m sql_lineage.cli --version)",
46
+ "Bash(C:/Users/e-jeffrey.yapi/AppData/Local/Temp/claude/c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage/1a12472a-8ff0-46e6-a119-590cdf9329aa/scratchpad/venv_test/Scripts/python.exe -c ' *)",
47
+ "Bash(C:/Users/e-jeffrey.yapi/AppData/Local/Temp/claude/c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage/1a12472a-8ff0-46e6-a119-590cdf9329aa/scratchpad/venv_test/Scripts/python.exe -m sql_lineage.cli extract --source notebooks --path c:/Users/e-jeffrey.yapi/Downloads/repo/py-lineage/examples --glob 00_Silver_Ipaki_v2.ipynb --config C:/Users/e-jeffrey.yapi/AppData/Local/Temp/claude/c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage/1a12472a-8ff0-46e6-a119-590cdf9329aa/scratchpad/conv.toml --out C:/Users/e-jeffrey.yapi/AppData/Local/Temp/claude/c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage/1a12472a-8ff0-46e6-a119-590cdf9329aa/scratchpad/out.json)",
48
+ "Bash(C:/Users/e-jeffrey.yapi/AppData/Local/Temp/claude/c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage/1a12472a-8ff0-46e6-a119-590cdf9329aa/scratchpad/venv_test/Scripts/python.exe -c 'import sql_lineage.cli as c; print\\(c.__file__\\)')",
49
+ "Bash(C:/Users/e-jeffrey.yapi/AppData/Local/Temp/claude/c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage/1a12472a-8ff0-46e6-a119-590cdf9329aa/scratchpad/venv_test/Scripts/python.exe -c 'import sql_lineage.cli as c; print\\('\\\\''--config'\\\\'' in open\\(c.__file__,encoding='\\\\''utf-8'\\\\''\\).read\\(\\)\\)')",
50
+ "Bash(rtk git commit -q -m 'feat\\(config\\): externalize all conventions into an injectable LineageConfig \\(Phase 2\\) *)",
51
+ "Bash(.venv/Scripts/python.exe -m pip install -q ruff mypy pytest-cov)",
52
+ "Bash(.venv/Scripts/python.exe -m ruff --version)",
53
+ "Bash(.venv/Scripts/python.exe -m ruff check src tests)",
54
+ "Bash(.venv/Scripts/python.exe -m mypy src/sql_lineage)",
55
+ "Bash(.venv/Scripts/python.exe -m pytest -q --cov=sql_lineage --cov-report=term-missing)",
56
+ "Bash(rtk git commit -q -m 'ci: add GitHub Actions \\(lint/mypy/test matrix/build\\) + PyPI release via OIDC \\(Phase 4\\) *)",
57
+ "Bash(.venv/Scripts/python.exe \"C:\\\\Users\\\\E-JEFF~1.YAP\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage\\\\1a12472a-8ff0-46e6-a119-590cdf9329aa\\\\scratchpad\\\\probe3.py\")",
58
+ "Bash(.venv/Scripts/python.exe \"C:\\\\Users\\\\E-JEFF~1.YAP\\\\AppData\\\\Local\\\\Temp\\\\claude\\\\c--Users-e-jeffrey-yapi-Downloads-repo-py-lineage\\\\1a12472a-8ff0-46e6-a119-590cdf9329aa\\\\scratchpad\\\\probe4.py\")",
59
+ "Bash(.venv/Scripts/python.exe -m pytest -q --cov)",
60
+ "Bash(.venv/Scripts/python.exe -m mypy)",
61
+ "Bash(.venv/Scripts/python.exe -m pytest tests/test_phase3_robustness.py tests/test_lineage_extractor.py -q)",
62
+ "Bash(rtk git commit -q -m 'feat\\(parsing\\): expand resolvable SELECT * + drop f-string clause fragments \\(Phase 3\\) *)",
63
+ "Bash(UPDATE_GOLDEN=1 .venv/Scripts/python.exe -m pytest tests/test_golden_manifest.py -q)",
64
+ "Bash(.venv/Scripts/python.exe -m pytest tests/test_golden_manifest.py -q)",
65
+ "Bash(rtk git commit -q -m 'test\\(manifest\\): schema governance — golden test + evolution policy \\(Phase 5\\) *)",
66
+ "Bash(.venv/Scripts/python.exe -m pytest -q -k \"not ipaki\")",
67
+ "Bash(rtk git commit -q -m 'docs\\(fabric\\): usage guide + ready orchestration script \\(Phase 6\\) *)",
68
+ "Bash(git remote *)",
69
+ "Bash(git ls-remote *)",
70
+ "Bash(rtk git commit -q -m 'ci: fix ruff lint findings \\(exclude fixture notebooks, tidy test imports\\) *)",
71
+ "Bash(rtk git commit -q -m 'ci: fix last ruff I001 \\(blank lines after imports in test_config\\) *)",
72
+ "Bash(rtk git commit -q -m 'docs\\(changelog\\): mark 0.1.1 as the first published release *)"
73
+ ]
74
+ }
75
+ }
@@ -0,0 +1,75 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ lint:
15
+ name: Lint & types
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0 # setuptools-scm a besoin de l'historique/tags
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.12"
24
+ - name: Install (dev)
25
+ run: python -m pip install -e ".[dev]"
26
+ - name: Ruff (lint)
27
+ run: ruff check src tests
28
+ - name: Mypy
29
+ run: mypy
30
+
31
+ test:
32
+ name: Tests (py${{ matrix.python-version }})
33
+ runs-on: ubuntu-latest
34
+ strategy:
35
+ fail-fast: false
36
+ matrix:
37
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ with:
41
+ fetch-depth: 0
42
+ - uses: actions/setup-python@v5
43
+ with:
44
+ python-version: ${{ matrix.python-version }}
45
+ - name: Install (dev)
46
+ run: python -m pip install -e ".[dev]"
47
+ - name: Pytest + couverture
48
+ run: pytest --cov
49
+ - name: Smoke test CLI
50
+ run: |
51
+ sql-lineage --version
52
+ sql-lineage extract --source files --path tests/fixtures/sql_chain --dialect tsql --out manifest.json
53
+ sql-lineage validate manifest.json
54
+
55
+ build:
56
+ name: Build & vérif metadata
57
+ runs-on: ubuntu-latest
58
+ needs: [lint, test]
59
+ steps:
60
+ - uses: actions/checkout@v4
61
+ with:
62
+ fetch-depth: 0
63
+ - uses: actions/setup-python@v5
64
+ with:
65
+ python-version: "3.12"
66
+ - name: Build (wheel + sdist)
67
+ run: |
68
+ python -m pip install build twine
69
+ python -m build
70
+ - name: Twine check
71
+ run: twine check dist/*
72
+ - uses: actions/upload-artifact@v4
73
+ with:
74
+ name: dist
75
+ path: dist/
@@ -0,0 +1,52 @@
1
+ name: Release
2
+
3
+ # Publie sur PyPI quand un tag de version (vX.Y.Z) est poussé.
4
+ # Utilise le "Trusted Publishing" (OIDC) : aucun token PyPI à stocker.
5
+ #
6
+ # Prérequis côté PyPI (une seule fois) :
7
+ # 1. Créer le projet / le "pending publisher" sur https://pypi.org/manage/account/publishing/
8
+ # 2. Owner = easytalents, repository = sql-lineage-extractor,
9
+ # workflow = release.yml, environment = pypi
10
+ # Prérequis côté GitHub :
11
+ # - Un environment nommé "pypi" (Settings > Environments), idéalement protégé.
12
+
13
+ on:
14
+ push:
15
+ tags: ["v*"]
16
+
17
+ jobs:
18
+ build:
19
+ name: Build
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0 # tags requis par setuptools-scm
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+ - name: Build (wheel + sdist)
29
+ run: |
30
+ python -m pip install build twine
31
+ python -m build
32
+ - name: Twine check
33
+ run: twine check dist/*
34
+ - uses: actions/upload-artifact@v4
35
+ with:
36
+ name: dist
37
+ path: dist/
38
+
39
+ publish:
40
+ name: Publish to PyPI
41
+ needs: build
42
+ runs-on: ubuntu-latest
43
+ environment: pypi
44
+ permissions:
45
+ id-token: write # OIDC — indispensable au Trusted Publishing
46
+ steps:
47
+ - uses: actions/download-artifact@v4
48
+ with:
49
+ name: dist
50
+ path: dist/
51
+ - name: Publish
52
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,35 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+ wheelhouse/
9
+
10
+ # setuptools-scm generated version file
11
+ src/sql_lineage/_version.py
12
+
13
+ # Environnements virtuels
14
+ .venv/
15
+ venv/
16
+ env/
17
+
18
+ # Tests / couverture
19
+ .pytest_cache/
20
+ .coverage
21
+ htmlcov/
22
+ .tox/
23
+ .mypy_cache/
24
+ .ruff_cache/
25
+
26
+ # IDE / OS
27
+ .vscode/
28
+ .idea/
29
+ .DS_Store
30
+ Thumbs.db
31
+
32
+ # Sorties de l'outil (manifests / exports générés localement)
33
+ *.manifest.json
34
+ exports/
35
+ lineage.db
@@ -0,0 +1,83 @@
1
+ # Changelog
2
+
3
+ Toutes les modifications notables de ce projet sont documentées ici.
4
+
5
+ Le format s'inspire de [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/),
6
+ et le projet suit le [versionnage sémantique](https://semver.org/lang/fr/).
7
+
8
+ Le champ `schema_version` du manifest évolue **indépendamment** de la version du
9
+ package (voir la politique de gouvernance du schéma dans
10
+ [docs/ROADMAP_STANDALONE.md](docs/ROADMAP_STANDALONE.md)).
11
+
12
+ ## [Non publié]
13
+
14
+ ## [0.1.1] - 2026-07-27
15
+
16
+ Première version publiée sur PyPI.
17
+
18
+ ### Ajouté
19
+ - Fichier `LICENSE` (Apache 2.0) et `NOTICE` (copyright EasyTalents).
20
+ - Marqueur `py.typed` (PEP 561) : les annotations de type sont exposées aux
21
+ consommateurs.
22
+ - Métadonnées de packaging enrichies (`authors`, `classifiers`, `keywords`,
23
+ `urls`) et versionnage automatique via `setuptools-scm`.
24
+ - `CHANGELOG.md` et `CONTRIBUTING.md`.
25
+ - **`LineageConfig`** (`sql_lineage.config`) : objet immuable et injectable qui
26
+ externalise **toutes** les conventions codées en dur (regex du commentaire d'id,
27
+ préfixes de variables, jeton de neutralisation, dialecte par défaut). Chargeable
28
+ depuis un mapping ou un fichier `.toml`/`.json` (`from_mapping` / `from_file`,
29
+ avec support de la table `[tool.sql_lineage]`).
30
+ - Flags CLI `--config`, `--id-comment-pattern`, `--var-prefix` (répétable) et
31
+ `--param-token` ; précédence : défauts < fichier de config < flags.
32
+ - La convention `-- lineage:id=` s'applique désormais aussi aux fichiers `.sql`
33
+ (un commentaire dans le fichier l'emporte sur l'id dérivé du nom de fichier).
34
+ - **Expansion des `SELECT *` résolubles** : un `SELECT *` (ou `t.*`) au-dessus
35
+ d'un **CTE ou d'une sous-requête énumérable** (y compris imbriqués `T.*`) est
36
+ désormais expansé automatiquement via les `Scope` de sqlglot, au lieu d'être
37
+ rejeté. Un `SELECT *` sur **table physique** reste rejeté (colonnes inconnues).
38
+ - **Neutralisation des fragments f-string au niveau instruction** : une
39
+ interpolation seule sur sa ligne (clause conditionnelle du type
40
+ `{'' if x is None else 'AND t.c IN ' + x}`) est **supprimée** au lieu d'être
41
+ remplacée par un `__PARAM__` orphelin qui cassait le parsing.
42
+ - Régression : sur le notebook réel `00_Silver_Ipaki.ipynb`, on passe de **2/18**
43
+ à **16/18** objets résolus (316 colonnes, 205 avec lineage) ; fixtures de
44
+ non-régression ajoutées.
45
+ - **Gouvernance du schéma** : politique d'évolution documentée
46
+ ([docs/MANIFEST_SCHEMA.md](docs/MANIFEST_SCHEMA.md)) ; **golden manifest test**
47
+ (comparaison octet-pour-octet d'une entrée figée) + auto-validation de
48
+ `schema.json` (Draft-07) et du format `schema_version` (`MAJOR.MINOR`).
49
+ `schema.json` : `$id` réel (GitHub) + `pattern` sur `schema_version`.
50
+ - **Guide d'intégration Fabric** ([docs/FABRIC_USAGE.md](docs/FABRIC_USAGE.md)) :
51
+ exécution hors Spark, export Warehouse via connexion Service Principal injectée,
52
+ caveats T-SQL Fabric ; + script d'orchestration prêt à l'emploi
53
+ ([examples/fabric_orchestration.py](examples/fabric_orchestration.py)).
54
+
55
+ - **Intégration continue** (GitHub Actions) : lint `ruff` + typage `mypy`, tests
56
+ sur matrice Python 3.10 → 3.13 avec seuil de couverture (85 %), smoke-test CLI,
57
+ build + `twine check`. Workflow de release qui **publie sur PyPI via Trusted
58
+ Publishing (OIDC)** sur push d'un tag `vX.Y.Z`.
59
+ - Configuration outillage dans `pyproject.toml` (`[tool.ruff]`, `[tool.mypy]`,
60
+ `[tool.coverage]`) et outils ajoutés à l'extra `dev` (`ruff`, `mypy`,
61
+ `pytest-cov`, `types-jsonschema`).
62
+
63
+ ### Modifié
64
+ - Licence passée de MIT à **Apache 2.0**.
65
+ - Dépendance `sqlglot` bornée (`>=25,<27`) ; ajout de `tomli` (Python < 3.11).
66
+ - Annotations de type durcies (mypy vert) : `TypeGuard` sur la détection d'appel
67
+ `.sql(...)`, typages CLI corrigés.
68
+ - `__version__` est désormais résolu depuis les métadonnées du package installé
69
+ (plus de valeur codée en dur).
70
+ - Les sources (`NotebookSQLSource`, `FileSQLSource`, `LiveSQLEndpointSource`)
71
+ acceptent un paramètre `config=` ; `dialect` devient optionnel (repli sur
72
+ `config.default_dialect`). **Rétro-compatible** : les défauts reproduisent le
73
+ comportement historique.
74
+
75
+ ### Déplacé
76
+ - Scripts prototypes `demo_sqlglot_lineage.py` et `test-py-lineage.py` déplacés
77
+ de la racine vers `examples/prototypes/`.
78
+
79
+ ## [0.1.0]
80
+
81
+ - Version initiale : extraction de lineage SQL colonne-à-colonne (sources
82
+ fichiers / notebooks / live), manifest JSON schématisé, export BI (CSV /
83
+ SQLite / SQL Server), CLI `sql-lineage`.
@@ -0,0 +1,64 @@
1
+ # Contribuer à sql-lineage-extractor
2
+
3
+ Merci de votre intérêt ! Ce projet est maintenu par **EasyTalents** et distribué
4
+ sous licence **Apache 2.0**.
5
+
6
+ ## Prérequis
7
+
8
+ - Python ≥ 3.10 (le CI teste 3.10 → 3.13).
9
+
10
+ ## Mise en place de l'environnement de dev
11
+
12
+ ```bash
13
+ python -m venv .venv
14
+ # Windows : .venv\Scripts\activate | Unix : source .venv/bin/activate
15
+ pip install -e ".[dev]"
16
+ ```
17
+
18
+ ## Lancer les tests
19
+
20
+ ```bash
21
+ pytest
22
+ ```
23
+
24
+ Aucun test ne nécessite de connexion réseau ni d'accès à un environnement Fabric
25
+ réel — le mode live est couvert par une connexion **mockée**.
26
+
27
+ ## Style de code
28
+
29
+ - Respecter le style et l'idiome du code existant (dataclasses simples, couches
30
+ découpées, aucune dépendance à un SDK propriétaire).
31
+ - Le parsing SQL passe **toujours** par `sqlglot` ; le code Python des notebooks
32
+ est analysé avec `ast`, **jamais** par regex.
33
+ - Le module reste **générique** : ne jamais coder en dur une convention propre à
34
+ un projet client. Toute convention (préfixe de variable, commentaire d'id,
35
+ jeton de neutralisation, dialecte) doit passer par la configuration.
36
+
37
+ ## Le contrat du manifest
38
+
39
+ `src/sql_lineage/manifest/schema.json` est le **contrat public**. Toute évolution
40
+ suit le versionnage du champ `schema_version` :
41
+
42
+ - ajout rétro-compatible → incrément *mineur* ;
43
+ - changement cassant → incrément *majeur* + entrée au `CHANGELOG.md`.
44
+
45
+ Les tests « golden manifest » doivent rester verts (le writer est déterministe).
46
+
47
+ ## Processus de contribution
48
+
49
+ 1. Créer une branche depuis `main`.
50
+ 2. Ajouter des tests couvrant le changement.
51
+ 3. Mettre à jour le `CHANGELOG.md` (section « Non publié »).
52
+ 4. Ouvrir une Pull Request ; la CI doit être verte (tests + lint + build).
53
+
54
+ ## Publier une version (mainteneurs)
55
+
56
+ Le versionnage est géré par `setuptools-scm` à partir des tags git :
57
+
58
+ ```bash
59
+ git tag v0.2.0
60
+ git push origin v0.2.0
61
+ ```
62
+
63
+ Le tag déclenche la publication sur PyPI via **Trusted Publishing (OIDC)** —
64
+ aucun token à gérer manuellement.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and do
117
+ not modify the License. You may add Your own attribution notices
118
+ within Derivative Works that You distribute, alongside or as an
119
+ addendum to the NOTICE text from the Work, provided that such
120
+ additional attribution notices cannot be construed as modifying
121
+ the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 EasyTalents
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,13 @@
1
+ sql-lineage-extractor
2
+ Copyright 2026 EasyTalents
3
+
4
+ This product was developed by EasyTalents.
5
+ Author: Jeffrey YAPI
6
+
7
+ Licensed under the Apache License, Version 2.0 (see the LICENSE file).
8
+
9
+ This product depends on third-party software distributed under their own
10
+ licenses, notably:
11
+ - sqlglot (MIT License) — https://github.com/tobymao/sqlglot
12
+ - click (BSD-3-Clause License)
13
+ - jsonschema (MIT License)