Smart reproducible analytical pipeline inspection.
Introduction
What is smartrappy for?
smartrappy is designed to help you understand the dependencies in a project, especially in a context where there may be a lot of legacy code that resembles tangled spaghetti.
What does this package do?
smartrappy analyses a Python project and infers the directed acyclic graph (DAG) of the code and data dependencies, including the last time any data were refreshed and whether the data exist at all on disk. It is not perfect, and will miss a lot in complex projects: but for simple projects using, say, pd.read_csv(), it does a good job of inferring the steps. It can also infer writing to and from most databases. The inferred DAG is then visualised, and there are several options for doing that—the default being to produce a visualisation in the terminal.
Quickstart
To use smartrappy as a command-line tool, install it with uv tool install smartrappy and run it with
uvx smartrappy /path/to/your/project
Or to use it within a Python script:
from smartrappy import analyse_project from smartrappy.reporters import ConsoleReporter model = analyse_project("/path/to/your/project") reporter = ConsoleReporter() reporter.generate_report(model)
Installation
To install smartrappy, you can use pip install smartrappy or uv add smartrappy if you are using Astral's uv. You can also use it as a standalone command-line tool with uv and the uvx command:
uvx smartrappy path/to/your/project
Documentation
You can find the full documentation for smartrappy at https://aeturrell.github.io/smartrappy/.