coltrace 0.1.0.dev4__tar.gz → 0.1.0.dev6__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 (122) hide show
  1. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/MANIFEST.in +2 -1
  2. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/PKG-INFO +76 -8
  3. coltrace-0.1.0.dev4/src/coltrace.egg-info/PKG-INFO → coltrace-0.1.0.dev6/README.md +282 -240
  4. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/accuracy.md +6 -0
  5. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/architecture.md +32 -2
  6. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/backlog.md +26 -10
  7. coltrace-0.1.0.dev6/docs/compatibility-checkpoint.md +88 -0
  8. coltrace-0.1.0.dev6/docs/database-patterns.md +101 -0
  9. coltrace-0.1.0.dev6/docs/database-sources.md +235 -0
  10. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/decisions.md +15 -1
  11. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/lineage-json.md +40 -4
  12. coltrace-0.1.0.dev6/docs/pandas-sources-proposal.md +109 -0
  13. coltrace-0.1.0.dev6/docs/read-capture.md +161 -0
  14. coltrace-0.1.0.dev6/docs/source-checkpoint.md +63 -0
  15. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/supported-patterns.md +82 -12
  16. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/troubleshooting.md +8 -0
  17. coltrace-0.1.0.dev6/examples/database_pipeline/README.md +34 -0
  18. coltrace-0.1.0.dev6/examples/database_pipeline/build_query.py +18 -0
  19. coltrace-0.1.0.dev6/examples/database_pipeline/pipeline.py +11 -0
  20. coltrace-0.1.0.dev6/examples/database_pipeline/pyproject.toml +11 -0
  21. coltrace-0.1.0.dev6/examples/notebook_cell.py +159 -0
  22. coltrace-0.1.0.dev6/examples/read_capture/README.md +29 -0
  23. coltrace-0.1.0.dev6/examples/read_capture/project/input.csv +3 -0
  24. coltrace-0.1.0.dev6/examples/read_capture/project/pipeline.py +9 -0
  25. coltrace-0.1.0.dev6/examples/read_capture/run_capture.py +36 -0
  26. coltrace-0.1.0.dev6/examples/robustness_pipeline/README.md +29 -0
  27. coltrace-0.1.0.dev6/examples/robustness_pipeline/extract.py +13 -0
  28. coltrace-0.1.0.dev6/examples/robustness_pipeline/pipeline.py +14 -0
  29. coltrace-0.1.0.dev6/examples/robustness_pipeline/transform.py +22 -0
  30. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/pyproject.toml +4 -2
  31. coltrace-0.1.0.dev6/src/coltrace/__init__.py +22 -0
  32. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/analysis.py +1654 -55
  33. coltrace-0.1.0.dev6/src/coltrace/capture.py +212 -0
  34. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/cli.py +55 -13
  35. coltrace-0.1.0.dev6/src/coltrace/compatibility.py +172 -0
  36. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/exporters.py +34 -5
  37. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/graph.py +6 -0
  38. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/history.py +2 -0
  39. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/journey.py +10 -1
  40. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/lineage_models.py +5 -2
  41. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/models.py +1 -1
  42. coltrace-0.1.0.dev6/src/coltrace/nosql_sources.py +290 -0
  43. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/scanner.py +56 -4
  44. coltrace-0.1.0.dev6/src/coltrace/source_models.py +217 -0
  45. coltrace-0.1.0.dev6/src/coltrace/source_readers.py +83 -0
  46. coltrace-0.1.0.dev6/src/coltrace/sql_sources.py +355 -0
  47. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/templates/graph.html +26 -0
  48. coltrace-0.1.0.dev4/README.md → coltrace-0.1.0.dev6/src/coltrace.egg-info/PKG-INFO +308 -219
  49. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace.egg-info/SOURCES.txt +43 -0
  50. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace.egg-info/requires.txt +7 -0
  51. coltrace-0.1.0.dev6/tests/integration/test_annotation_effects.py +238 -0
  52. coltrace-0.1.0.dev6/tests/integration/test_capture_workflow.py +53 -0
  53. coltrace-0.1.0.dev6/tests/integration/test_compatibility_cli.py +51 -0
  54. coltrace-0.1.0.dev6/tests/integration/test_conditional_flow.py +332 -0
  55. coltrace-0.1.0.dev6/tests/integration/test_database_sources.py +287 -0
  56. coltrace-0.1.0.dev6/tests/integration/test_nosql_extraction.py +294 -0
  57. coltrace-0.1.0.dev6/tests/integration/test_notebook_reporting.py +77 -0
  58. coltrace-0.1.0.dev6/tests/integration/test_pandas_observation.py +192 -0
  59. coltrace-0.1.0.dev6/tests/integration/test_reader_inventory.py +93 -0
  60. coltrace-0.1.0.dev6/tests/integration/test_source_config.py +186 -0
  61. coltrace-0.1.0.dev6/tests/integration/test_source_precision.py +133 -0
  62. coltrace-0.1.0.dev6/tests/integration/test_sql_reader_boundaries.py +300 -0
  63. coltrace-0.1.0.dev6/tests/unit/test_compatibility.py +124 -0
  64. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_exporters.py +3 -1
  65. coltrace-0.1.0.dev6/tests/unit/test_nosql_sources.py +242 -0
  66. coltrace-0.1.0.dev6/tests/unit/test_read_capture.py +372 -0
  67. coltrace-0.1.0.dev6/tests/unit/test_source_models.py +283 -0
  68. coltrace-0.1.0.dev6/tests/unit/test_source_presentation.py +116 -0
  69. coltrace-0.1.0.dev6/tests/unit/test_sql_sources.py +350 -0
  70. coltrace-0.1.0.dev4/src/coltrace/__init__.py +0 -9
  71. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/LICENSE +0 -0
  72. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/column-history.md +0 -0
  73. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/column-journey-checkpoint.md +0 -0
  74. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/discovery-json.md +0 -0
  75. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/graph-workspace-checkpoint.md +0 -0
  76. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/history-checkpoint.md +0 -0
  77. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/mvp-checkpoint.md +0 -0
  78. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/nlp-checkpoint.md +0 -0
  79. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/other-column-checkpoint.md +0 -0
  80. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/docs/phase-1.md +0 -0
  81. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/pricing_pipeline/extract/prices.py +0 -0
  82. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/pricing_pipeline/features/pricing.py +0 -0
  83. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/pricing_pipeline/pipeline.py +0 -0
  84. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/pricing_pipeline/transform/pricing.py +0 -0
  85. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/sample_pipeline/prices.py +0 -0
  86. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/text_pipeline/README.md +0 -0
  87. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/text_pipeline/pipeline.py +0 -0
  88. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/text_pipeline/processing.py +0 -0
  89. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/text_pipeline/readers.py +0 -0
  90. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/examples/text_pipeline/text.py +0 -0
  91. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/setup.cfg +0 -0
  92. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/__main__.py +0 -0
  93. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/callbacks.py +0 -0
  94. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/collector.py +0 -0
  95. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/py.typed +0 -0
  96. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace/visual_layout.py +0 -0
  97. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace.egg-info/dependency_links.txt +0 -0
  98. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace.egg-info/entry_points.txt +0 -0
  99. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/src/coltrace.egg-info/top_level.txt +0 -0
  100. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/fixtures/sample_pipeline/extract/prices.py +0 -0
  101. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/fixtures/sample_pipeline/features/pricing.py +0 -0
  102. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/fixtures/sample_pipeline/pipeline.py +0 -0
  103. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/fixtures/sample_pipeline/transform/pricing.py +0 -0
  104. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_callback_roles.py +0 -0
  105. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_cli.py +0 -0
  106. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_column_story.py +0 -0
  107. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_journey_boundaries.py +0 -0
  108. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_lineage_acceptance.py +0 -0
  109. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_other_column_stories.py +0 -0
  110. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_pandas_boundaries.py +0 -0
  111. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_resolution_boundaries.py +0 -0
  112. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_scan_project.py +0 -0
  113. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/integration/test_text_pipeline.py +0 -0
  114. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_analysis.py +0 -0
  115. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_callbacks.py +0 -0
  116. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_collector.py +0 -0
  117. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_graph.py +0 -0
  118. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_graph_workspace.py +0 -0
  119. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_history.py +0 -0
  120. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_journey.py +0 -0
  121. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/tests/unit/test_scanner.py +0 -0
  122. {coltrace-0.1.0.dev4 → coltrace-0.1.0.dev6}/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.dev6
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.dev6`.** 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,73 @@ 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 source 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
+
94
+ ## Common Python scaffolding
95
+
96
+ The dev6 checkpoint preserves independent DataFrame lineage across ordinary
97
+ type annotations and unrelated configuration expressions. It supports bounded
98
+ `copy(deep=True)`, `head(n)` and immutable `shape` observations.
99
+
100
+ Selected `if`, `try`, `with` and loop paths are inspected independently. Facts
101
+ from uncertain paths have inferred evidence. Mutated pre-existing frames and
102
+ incompatible bindings remain explicit join boundaries; general path merging is
103
+ not claimed. This makes previously skipped reads visible without treating every
104
+ alternative as confirmed execution. Static scanning still executes no project
105
+ code. See the [compatibility checkpoint](docs/compatibility-checkpoint.md) and
106
+ [multi-module example](examples/robustness_pipeline/README.md).
107
+
108
+ Notebook output separates discovered files from modeled frames/columns, shows
109
+ configuration and versions, prints errors first, and saves full diagnostics
110
+ before attempting column selection. Listed static labels are not runtime
111
+ `df.columns`. Capture remains opt-in.
112
+
49
113
  ## Try the complete example
50
114
 
51
115
  ```sh
@@ -141,11 +205,15 @@ the shortest eligible distance, so a node reached both ways appears as direct.
141
205
  | Pattern | Support |
142
206
  | --- | --- |
143
207
  | 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 |
208
+ | Resolved `pd.read_*` calls | Located inventory; supported DataFrame readers plus explicit/observed source schemas; iterators/collections remain distinct |
209
+ | SQL-to-Pandas extraction | Bounded SQL projections, aliases, expressions and helpers; documented readers/conversions or explicit contracts |
210
+ | MongoDB / DynamoDB extraction | Literal projections and bounded Mongo expressions; candidate fields stay partial without observed schema |
145
211
  | Literal dictionary `DataFrame` construction | String column keys and literal values |
146
212
  | `frame["column"]`, `frame.loc[:, "column"]` | Single literal string labels, all rows |
147
213
  | `frame["c"] = frame["a"] + frame["b"]` | Arithmetic, scalar constants, temporary values, versions |
148
214
  | `alias = frame` | Same abstract object and shared mutation |
215
+ | `copy(deep=True)`, `head(n)`, `shape` | Bounded independent copies, row previews and immutable metadata observations |
216
+ | Selected conditional/exception/context blocks | Separate inferred paths; explicit uncertainty at joins |
149
217
  | `rename(columns={"old": "new"})` | Literal, non-colliding map; new DataFrame, or shared mutation with `inplace=True` |
150
218
  | `assign(b=lambda x: x["a"] * 2)` | Sequential simple lambdas; eager arguments use their original scope |
151
219
  | `Series.apply(clean_text)` | Resolved scalar callbacks; bounded summaries and inferred evidence |
@@ -200,7 +268,7 @@ print(report.to_json())
200
268
 
201
269
  The earlier `scan_project` API remains available for raw occurrences and receiver
202
270
  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
271
+ snapshot (`0.4`). See [discovery JSON](docs/discovery-json.md) and
204
272
  [lineage JSON](docs/lineage-json.md). Public facts are dataclasses; their serialized
205
273
  form is independent of NetworkX and contains no AST or executable objects.
206
274