A static analysis tool for PHP that finds bugs in code without running it.
tach-org/tach
A Python tool, written in Rust, that visualizes and enforces module dependencies and public interfaces in a codebase.
- Stars
- 2,861
- Forks
- 98
- Open issues
- 56
- Last commit
- 9 days ago
What is it?
Tach helps Python projects keep their module boundaries intact. You declare which modules may depend on which, and it checks imports against those declarations, flagging any import that crosses a boundary it should not. It can also restrict cross-module calls to a module's declared public interface and detect cycles in the dependency graph.
It is designed for modular monolith layouts and can be adopted incrementally, so teams can mark only the packages they want to track. Setup is interactive through `tach init`, and `tach check` exits with a non-zero code on violations, which makes it straightforward to run in CI or as a pre-commit hook.
Tach can also render the dependency graph, either as a web view with `tach show --web` or as a local GraphViz DOT file, and `tach report` lists the dependencies and usages of a given path.
Key features
- 01Checks imports against declared module dependencies
- 02Restricts cross-module calls to public interfaces
- 03Detects cycles in the dependency graph
- 04Supports incremental adoption by marking only selected modules
- 05Visualizes dependencies as a web graph or GraphViz DOT output
- 06Integrates with CI and pre-commit hooks via a non-zero exit on violations
Use cases
- Enforcing layered or modular boundaries in a large Python monolith
- Preventing unwanted imports between packages in a Python monorepo
- Gradually introducing architectural rules into an existing codebase
- Reviewing a project's dependency structure through a generated graph
Quick start
- 1
Install Tach from PyPI
pip install tach - 2
Run the interactive setup to mark module boundaries
tach init - 3
Enforce the configured boundaries from your project root
tach check
Things to know
- Only supports Python codebases.
- Enforces boundaries statically and requires manually declaring module dependencies in tach.toml.
In collections
Topics
FAQ
- What is tach?
- A Python tool, written in Rust, that visualizes and enforces module dependencies and public interfaces in a codebase. Tach helps Python projects keep their module boundaries intact. You declare which modules may depend on which, and it checks imports against those declarations, flagging any import that crosses a boundary it should not. It can also restrict cross-module calls to a module's declared public interface and detect cycles in the dependency graph.
- Is tach free to use? What license does it have?
- tach is open source under the MIT license. Check the license terms before using it in commercial products.
- Is tach still maintained?
- Actively maintained. The last commit to tach was on Oct 29, 2026.
- What can I use tach for?
- Enforcing layered or modular boundaries in a large Python monolith Preventing unwanted imports between packages in a Python monorepo Gradually introducing architectural rules into an existing codebase Reviewing a project's dependency structure through a generated graph
- How do I install tach?
- Install Tach from PyPI: pip install tach Run the interactive setup to mark module boundaries: tach init Enforce the configured boundaries from your project root: tach check
- Where can I get tach?
- The source code and installation instructions are on GitHub: https://github.com/tach-org/tach
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A fast, configurable Go linter that drops in for golint and supports custom rules and output formatters.
A Go CLI that runs any linter or code analysis tool and posts its findings as review comments on GitHub, GitLab or Bitbucket, limited to changed lines.
A static code analyser for Python that checks for errors, enforces coding standards, and flags code smells without running your code.
A pluggable linter for ECMAScript/JavaScript that finds problematic patterns in code and can automatically fix many of them.
A static analysis tool that finds bugs in Java, C, C++, and Objective-C code without running it.