coltrace 0.1.0.dev4__tar.gz → 0.1.0.dev5__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 (110) hide show
  1. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/MANIFEST.in +2 -1
  2. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/PKG-INFO +55 -8
  3. coltrace-0.1.0.dev4/src/coltrace.egg-info/PKG-INFO → coltrace-0.1.0.dev5/README.md +261 -240
  4. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/accuracy.md +6 -0
  5. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/architecture.md +18 -2
  6. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/backlog.md +21 -10
  7. coltrace-0.1.0.dev5/docs/database-patterns.md +101 -0
  8. coltrace-0.1.0.dev5/docs/database-sources.md +235 -0
  9. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/decisions.md +11 -1
  10. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/lineage-json.md +35 -4
  11. coltrace-0.1.0.dev5/docs/pandas-sources-proposal.md +109 -0
  12. coltrace-0.1.0.dev5/docs/read-capture.md +161 -0
  13. coltrace-0.1.0.dev5/docs/source-checkpoint.md +63 -0
  14. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/supported-patterns.md +34 -5
  15. coltrace-0.1.0.dev5/examples/database_pipeline/README.md +34 -0
  16. coltrace-0.1.0.dev5/examples/database_pipeline/build_query.py +18 -0
  17. coltrace-0.1.0.dev5/examples/database_pipeline/pipeline.py +11 -0
  18. coltrace-0.1.0.dev5/examples/database_pipeline/pyproject.toml +11 -0
  19. coltrace-0.1.0.dev5/examples/notebook_cell.py +128 -0
  20. coltrace-0.1.0.dev5/examples/read_capture/README.md +29 -0
  21. coltrace-0.1.0.dev5/examples/read_capture/project/input.csv +3 -0
  22. coltrace-0.1.0.dev5/examples/read_capture/project/pipeline.py +9 -0
  23. coltrace-0.1.0.dev5/examples/read_capture/run_capture.py +36 -0
  24. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/pyproject.toml +4 -2
  25. coltrace-0.1.0.dev5/src/coltrace/__init__.py +22 -0
  26. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/analysis.py +986 -16
  27. coltrace-0.1.0.dev5/src/coltrace/capture.py +212 -0
  28. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/cli.py +38 -2
  29. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/exporters.py +34 -5
  30. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/graph.py +6 -0
  31. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/journey.py +9 -0
  32. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/lineage_models.py +5 -2
  33. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/models.py +1 -1
  34. coltrace-0.1.0.dev5/src/coltrace/nosql_sources.py +290 -0
  35. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/scanner.py +56 -4
  36. coltrace-0.1.0.dev5/src/coltrace/source_models.py +217 -0
  37. coltrace-0.1.0.dev5/src/coltrace/source_readers.py +83 -0
  38. coltrace-0.1.0.dev5/src/coltrace/sql_sources.py +355 -0
  39. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/templates/graph.html +26 -0
  40. coltrace-0.1.0.dev4/README.md → coltrace-0.1.0.dev5/src/coltrace.egg-info/PKG-INFO +287 -219
  41. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace.egg-info/SOURCES.txt +31 -0
  42. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace.egg-info/requires.txt +7 -0
  43. coltrace-0.1.0.dev5/tests/integration/test_capture_workflow.py +53 -0
  44. coltrace-0.1.0.dev5/tests/integration/test_database_sources.py +287 -0
  45. coltrace-0.1.0.dev5/tests/integration/test_nosql_extraction.py +294 -0
  46. coltrace-0.1.0.dev5/tests/integration/test_reader_inventory.py +93 -0
  47. coltrace-0.1.0.dev5/tests/integration/test_source_config.py +186 -0
  48. coltrace-0.1.0.dev5/tests/integration/test_source_precision.py +133 -0
  49. coltrace-0.1.0.dev5/tests/integration/test_sql_reader_boundaries.py +300 -0
  50. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_exporters.py +3 -1
  51. coltrace-0.1.0.dev5/tests/unit/test_nosql_sources.py +242 -0
  52. coltrace-0.1.0.dev5/tests/unit/test_read_capture.py +372 -0
  53. coltrace-0.1.0.dev5/tests/unit/test_source_models.py +283 -0
  54. coltrace-0.1.0.dev5/tests/unit/test_source_presentation.py +116 -0
  55. coltrace-0.1.0.dev5/tests/unit/test_sql_sources.py +350 -0
  56. coltrace-0.1.0.dev4/src/coltrace/__init__.py +0 -9
  57. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/LICENSE +0 -0
  58. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/column-history.md +0 -0
  59. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/column-journey-checkpoint.md +0 -0
  60. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/discovery-json.md +0 -0
  61. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/graph-workspace-checkpoint.md +0 -0
  62. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/history-checkpoint.md +0 -0
  63. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/mvp-checkpoint.md +0 -0
  64. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/nlp-checkpoint.md +0 -0
  65. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/other-column-checkpoint.md +0 -0
  66. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/phase-1.md +0 -0
  67. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/docs/troubleshooting.md +0 -0
  68. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/pricing_pipeline/extract/prices.py +0 -0
  69. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/pricing_pipeline/features/pricing.py +0 -0
  70. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/pricing_pipeline/pipeline.py +0 -0
  71. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/pricing_pipeline/transform/pricing.py +0 -0
  72. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/sample_pipeline/prices.py +0 -0
  73. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/text_pipeline/README.md +0 -0
  74. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/text_pipeline/pipeline.py +0 -0
  75. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/text_pipeline/processing.py +0 -0
  76. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/text_pipeline/readers.py +0 -0
  77. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/examples/text_pipeline/text.py +0 -0
  78. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/setup.cfg +0 -0
  79. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/__main__.py +0 -0
  80. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/callbacks.py +0 -0
  81. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/collector.py +0 -0
  82. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/history.py +0 -0
  83. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/py.typed +0 -0
  84. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace/visual_layout.py +0 -0
  85. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace.egg-info/dependency_links.txt +0 -0
  86. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace.egg-info/entry_points.txt +0 -0
  87. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/src/coltrace.egg-info/top_level.txt +0 -0
  88. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/fixtures/sample_pipeline/extract/prices.py +0 -0
  89. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/fixtures/sample_pipeline/features/pricing.py +0 -0
  90. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/fixtures/sample_pipeline/pipeline.py +0 -0
  91. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/fixtures/sample_pipeline/transform/pricing.py +0 -0
  92. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_callback_roles.py +0 -0
  93. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_cli.py +0 -0
  94. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_column_story.py +0 -0
  95. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_journey_boundaries.py +0 -0
  96. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_lineage_acceptance.py +0 -0
  97. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_other_column_stories.py +0 -0
  98. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_pandas_boundaries.py +0 -0
  99. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_resolution_boundaries.py +0 -0
  100. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_scan_project.py +0 -0
  101. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/integration/test_text_pipeline.py +0 -0
  102. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_analysis.py +0 -0
  103. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_callbacks.py +0 -0
  104. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_collector.py +0 -0
  105. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_graph.py +0 -0
  106. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_graph_workspace.py +0 -0
  107. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_history.py +0 -0
  108. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_journey.py +0 -0
  109. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_scanner.py +0 -0
  110. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev5}/tests/unit/test_visual_layout.py +0 -0
@@ -1,4 +1,5 @@
1
1
  recursive-include docs *.md
2
- recursive-include examples *.py *.md
2
+ recursive-include examples *.py *.md *.toml
3
+ include examples/read_capture/project/input.csv
3
4
  recursive-include tests *.py
4
5
  recursive-include src/coltrace/templates *.html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coltrace
3
- Version: 0.1.0.dev4
3
+ Version: 0.1.0.dev5
4
4
  Summary: Static Pandas column lineage, impact analysis, and local dependency graphs
5
5
  Author: Cristiano Diniz
6
6
  License-Expression: MIT
@@ -15,6 +15,11 @@ Requires-Dist: ruff>=0.9; extra == "dev"
15
15
  Requires-Dist: mypy>=1.14; extra == "dev"
16
16
  Requires-Dist: build>=1.2; extra == "dev"
17
17
  Requires-Dist: types-networkx>=3.2; extra == "dev"
18
+ Requires-Dist: sqlglot<31,>=30.24; extra == "dev"
19
+ Provides-Extra: sql
20
+ Requires-Dist: sqlglot<31,>=30.24; extra == "sql"
21
+ Provides-Extra: capture
22
+ Requires-Dist: pandas<4,>=2; extra == "capture"
18
23
  Provides-Extra: viz
19
24
  Requires-Dist: pyvis<0.4,>=0.3.2; extra == "viz"
20
25
  Dynamic: license-file
@@ -23,10 +28,11 @@ Dynamic: license-file
23
28
 
24
29
  Static Pandas column lineage and potential impact analysis for Python projects.
25
30
  ColTrace reads source files, identifies supported transformations, and connects
26
- column versions across direct function calls. It never imports or executes the
27
- project or reads the project's input data.
31
+ column versions across direct function calls. Static scanning never imports or
32
+ executes the project or reads its input data. Optional read capture observes
33
+ column labels while you explicitly execute your own pipeline.
28
34
 
29
- **Development preview: `0.1.0.dev4`.** The supported subset is deliberately small.
35
+ **Development preview: `0.1.0.dev5`.** The supported subset is deliberately small.
30
36
  Unsupported operations produce diagnostics and may interrupt lineage. A graph
31
37
  with no edge is not proof that a dependency does not exist.
32
38
 
@@ -37,15 +43,54 @@ Requires Python 3.11+. From this checkout:
37
43
  ```sh
38
44
  python -m venv .venv
39
45
  # Activate .venv using your shell, then:
40
- python -m pip install -e ".[dev,viz]"
46
+ python -m pip install -e ".[dev,viz,sql,capture]"
41
47
  coltrace --help
42
48
  ```
43
49
 
44
50
  On Windows without activation, use `.\.venv\Scripts\python.exe -m coltrace`.
45
51
  The `viz` extra supplies PyVis for HTML export; basic analysis and JSON need only
46
- NetworkX and Typer. Pandas is not a runtime dependency. Publication to PyPI is a
52
+ NetworkX and Typer. `sql` adds SQLGlot for bounded SQL parsing; `capture` adds
53
+ Pandas for optional schema observation. Pandas is not a core dependency.
54
+ Publication to PyPI is a
47
55
  separate release step; these commands install the local project.
48
56
 
57
+ ## Start at the data source
58
+
59
+ The local dev5 checkpoint recognizes supported SQL-to-Pandas and NoSQL-to-Pandas
60
+ extractions. Literal SQL projections, aliases and expressions describe source
61
+ fields before their first Python use. Query filters are control metadata rather
62
+ than value dependencies of every output. The supplied
63
+ `spark.sql(build_query(table)).toPandas()` pattern works with a resolved Spark
64
+ session or an explicit source contract for an injected session.
65
+
66
+ `report.readers` inventories resolved `pd.read_*` calls with file, line, context,
67
+ return shape and resulting DataFrame identity. File schemas are unknown unless
68
+ declared or observed. To enumerate actual columns, including those never
69
+ explicitly referenced by the script:
70
+
71
+ ```python
72
+ from coltrace import analyze_project, capture_reads
73
+
74
+ with capture_reads(project_root) as capture:
75
+ run_pipeline() # You explicitly execute your existing pipeline.
76
+
77
+ report = analyze_project(project_root, source_schemas=capture.schemas)
78
+ ```
79
+
80
+ Capture retains column names and source locations, not rows or credentials.
81
+ Use `capture_dataframe_schema` for an already-loaded Pandas object, including a
82
+ SQL-to-Pandas conversion. Observations must attach to the corresponding analyzed
83
+ `.py` extraction site; arbitrary notebook-cell lineage remains unsupported.
84
+ Unknown SQL, wildcard schemas, dynamic calls and unsupported transformations
85
+ still produce gaps. Schema observation does not resolve hidden value lineage.
86
+
87
+ See [database source usage](docs/database-sources.md), the
88
+ [researched extraction matrix](docs/database-patterns.md), and
89
+ [read capture](docs/read-capture.md). Try the
90
+ [static SQL example](examples/database_pipeline/README.md) and
91
+ [executable capture example](examples/read_capture/README.md).
92
+ The [source checkpoint](docs/source-checkpoint.md) records validation and limits.
93
+
49
94
  ## Try the complete example
50
95
 
51
96
  ```sh
@@ -141,7 +186,9 @@ the shortest eligible distance, so a node reached both ways appears as direct.
141
186
  | Pattern | Support |
142
187
  | --- | --- |
143
188
  | Explicit Pandas imports and aliases | Recognized origins; names such as `df` alone are insufficient |
144
- | `read_csv`, `read_parquet` | External schema is unknown; CSV chunk/iterator forms are excluded |
189
+ | Resolved `pd.read_*` calls | Located inventory; supported DataFrame readers plus explicit/observed source schemas; iterators/collections remain distinct |
190
+ | SQL-to-Pandas extraction | Bounded SQL projections, aliases, expressions and helpers; documented readers/conversions or explicit contracts |
191
+ | MongoDB / DynamoDB extraction | Literal projections and bounded Mongo expressions; candidate fields stay partial without observed schema |
145
192
  | Literal dictionary `DataFrame` construction | String column keys and literal values |
146
193
  | `frame["column"]`, `frame.loc[:, "column"]` | Single literal string labels, all rows |
147
194
  | `frame["c"] = frame["a"] + frame["b"]` | Arithmetic, scalar constants, temporary values, versions |
@@ -200,7 +247,7 @@ print(report.to_json())
200
247
 
201
248
  The earlier `scan_project` API remains available for raw occurrences and receiver
202
249
  evidence. Its discovery report (`0.1`) is a different format from the lineage
203
- snapshot (`0.3`). See [discovery JSON](docs/discovery-json.md) and
250
+ snapshot (`0.4`). See [discovery JSON](docs/discovery-json.md) and
204
251
  [lineage JSON](docs/lineage-json.md). Public facts are dataclasses; their serialized
205
252
  form is independent of NetworkX and contains no AST or executable objects.
206
253