Prerequisites: Python 3.10+ and uv.
git clone https://github.com/guillermodotn/flowview.git
cd flowview
uv sync --group devRun tests:
uv run pytest tests/ -vLint and format:
uv run ruff check .
uv run ruff format .Run an example:
uv run python examples/method_chain_pipeline.pyflowview/
__init__.py Public API — exports `trace` and `__version__`
tracer.py @trace decorator — wraps DataFrame args in proxy, renders output
proxy.py TracedDataFrame — intercepts method calls, captures snapshots
collector.py capture_snapshot() — records row count, schema, sample data
models.py Data classes: StepSnapshot, SchemaDiff, PipelineTrace
renderer.py Rich terminal rendering — panels, tables, arrows
How tracing works:
@fv.tracewraps the firstpl.DataFrameargument in aTracedDataFrameproxy.- Every method call on the proxy (
.filter(),.with_columns(), etc.) is intercepted via__getattr__. - The real Polars method runs on the underlying DataFrame. If it returns a new DataFrame, a
StepSnapshotis captured and the result is re-wrapped in a fresh proxy. .pipe(fn)passes the real DataFrame tofnand records the result as a single step..group_by().agg()is recorded as a combined step.- When the decorated function returns, the proxy is unwrapped and a real
pl.DataFrameis returned. - The collected trace is rendered to the terminal using Rich.
No monkey-patching. No global state. Each call is isolated.
- Lowercase imperative mood:
add feature,fix bug,remove unused code - Keep commits incremental and independently testable
- Version is derived from git tags via hatch-vcs — no manual version bumps
- CI runs on every push: lint + format + tests across Python 3.10-3.13
- CD publishes to PyPI automatically on GitHub release (trusted publishing via OIDC)