skillfed

tach

A Python tool to maintain a modular package architecture.

tach v0.35.0 5.0M downloads/30d#2,185 on PyPI2,788
Permissive license Active released

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 tach

uv

uv add tach

poetry

poetry add tach

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Tags

python module boundary enforcementdependency graph validationcircular dependency detectionmodular monolith architectureimport policy enforcementpython package architecturemodule interface enforcement
architecture-enforcementmodular-monolithdependency-management

More Python Modules packages