tach
A Python tool to maintain a modular package architecture.
What it is and what it does
Tach is a Python tool written in Rust that enforces architectural boundaries within a codebase by validating module dependencies, public interfaces, and preventing circular imports. It works by reading a configuration file (tach.toml) where you define module boundaries and their allowed dependencies, then checks your code to ensure imports respect those rules.
You run `tach init` to interactively mark module boundaries in your project, then `tach check` to validate compliance. It integrates with CI/CD pipelines, pre-commit hooks, and IDEs, and provides visualization and reporting commands. The tool has no runtime impact—it only runs during development and testing—and can be adopted incrementally, allowing you to enforce rules on some modules while leaving others unchecked.
Use it for:
- Enforce layered architecture in a monolith by preventing lower layers from importing upper layers
- Detect and prevent circular dependencies between modules before they cause import errors
- Define and validate public APIs for modules so internal implementation details stay private
- Visualize your project's dependency graph with `tach show` to understand coupling
- Integrate module boundary checks into CI/CD to catch architectural violations before merge
- Incrementally adopt modular structure in legacy codebases by checking only new or refactored modules
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Tach enforces module boundaries, dependency rules, and public interfaces in Python projects, detecting violations like undeclared imports, cross-module calls outside public APIs, and circular dependencies.
Yes, if you maintain a Python monolith or multi-package project and want to prevent architectural drift. The tool is actively maintained, has no runtime overhead, and integrates cleanly into existing workflows. Medium install friction is offset by broad platform support and pre-built wheels. No known vulnerabilities. Start with `tach init` to evaluate fit for your codebase.
Install
tach on PyPI
pip
pip install tachuv
uv add tachpoetry
poetry add tachInstalling tach
Before you install
Medium install friction due to compiled Rust components, but pre-built wheels cover common platforms (macOS, Linux, Windows, multiple architectures). Active maintenance with recent releases; last commit 2026-06-11 and 2788 GitHub stars indicate ongoing development.
License in practice
MIT license (permissive) means you can use, modify, and distribute Tach freely with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install tach
# In your project root:
tach init
# (Interactive setup: navigate with arrow keys, mark module boundaries with Enter)
tach check
# Output: ✅ All modules validated! (or ❌ with violations)
Requires Python 3.10 or later. Compiled Rust wheels require a compatible platform; pure-Python fallback is not available.
Verify before relying
- Whether cp37-abi3 wheels indicate broader Python version support than requires_python >=3.10 suggests
- Performance characteristics when checking large monorepos or projects with thousands of modules
- How incremental adoption works in practice and whether partial enforcement can coexist with legacy code
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 8 — pyyaml, tomli, tomli-w, rich, prompt-toolkit, gitpython, networkx, pydot |
| Maintenance | actively maintained — 94 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,988,216/month — #2,185 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tach-0.35.0-cp37-abi3-macosx_10_12_x86_64.whl; tach-0.35.0-cp37-abi3-macosx_11_0_arm64.whl; tach-0.35.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tach-0.35.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; tach-0.35.0-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl; tach-0.35.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; tach-0.35.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl; tach-0.35.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tach-0.35.0-cp37-abi3-musllinux_1_2_aarch64.whl; tach-0.35.0-cp37-abi3-musllinux_1_2_armv7l.whl; tach-0.35.0-cp37-abi3-musllinux_1_2_i686.whl; tach-0.35.0-cp37-abi3-musllinux_1_2_ppc64le.whl; tach-0.35.0-cp37-abi3-musllinux_1_2_x86_64.whl; tach-0.35.0-cp37-abi3-win32.whl; tach-0.35.0-cp37-abi3-win_amd64.whl
Keywords: python, module, package, guard, enforcement, boundary, enforcer, domain, architecture
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
import-linterImport Linter enforces architectural…
permissive · top 5,000 on PyPI
pytest-archonPytest-archon lets you define and test…
permissive · top 15,000 on PyPI
fawltydepsFawltydeps identifies undeclared dependencies…
permissive · top 15,000 on PyPI
cyclicDetects and reports cyclic relationships in a…
permissive · top 15,000 on PyPI
import-depsAnalyzes Python module imports statically using…
permissive · top 5,000 on PyPI
type-enforcedEnforces Python type annotations at runtime…
permissive · top 15,000 on PyPI
py-import-cyclesDetects import cycles in Python projects by…
permissive · top 15,000 on PyPI
toposortImplements topological sorting of directed…
permissive · top 5,000 on PyPI
oslo.policyoslo.policy enforces role-based access control…
permissive · top 15,000 on PyPI
PyTestArchPyTestArch lets you define and test…
permissive · top 15,000 on PyPI