tach-org / tach
A Python tool to visualize + enforce dependencies, using modular architecture π Open source π Installable via pip π§ Able to be adopted incrementally - β‘ Implemented with no runtime impact βΎοΈ Interoperable with your existing systems π¦ Written in rust
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing tach-org/tach in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler viewTach Tach is a Python tool to enforce dependencies and interfaces, written in Rust. Tach is inspired by the modular monolith architecture. Docs https://github.com/user-attachments/assets/11eec4a1-f80a-4f13-9ff3-91a9760133b6 Tach can enforce: β’ π Imports only come from declared dependencies β’ π€ Cross-module calls use the public interface β’ βοΈβπ₯ No cycles in the dependency graph Tach is: β’ π Open source β’ π Installable via pip β’ π§ Able to be adopted incrementally β’ β‘ Implemented with no runtime impact β’ βΎοΈ Interoperable with your existing systems Getting Started Installation Setup Tach will guide you through initial project setup. Run: After an introductory message, you will see a file tree interface allowing you to interactively configure your project. Use the arrow keys to navigate, and mark each module boundary with 'Enter'. You can mark all of your top-level Python packages, or just a few that you want to track. FAQ: What is a module? If your Python code lives below your project root, or if you are working in a monorepo with multiple Python packages, mark your Python source roots using the 's' key. Enforcement Tach comes with a cli command to enforce the boundaries that you just set up! From the root of your Python project, run: You will see: You can validate that Tach is working by: β’ Removing an item from the key in , or marking it as deprecated β’ By adding an import between modules that didn't previously import from each other. Give both a try and run again. This will generate an error: Each error indicates an import which violates your dependencies. If your terminal supports hyperlinks, click on the file path to go directly to the error. When an error is detected, will exit with a non-zero code. It can be easily integrated with CI/CD, Pre-commit hooks, and VS Code, and more! Extras Visualize your dependency graph. Tach will generate a graph of your dependencies. Here's what this looks like for Tach: Note that this graph is generated remotely with the contents of your when running . If you would like to use the GraphViz DOT format locally, simply running will generate in your working directory. You can view the dependencies and usages for a given path: e.g.: Tach also supports: β’ Public interfaces for modules β’ Deprecating individual dependencies β’ Layered architecture β’ Incremental adoption β’ Generating JSON dependency maps β’ Monorepos and namespace packages β’ Domain ownership β’ Inline 'ignore' comments β’ Pre-commit hooks More info in the docs. If you have any feedback, we'd love to talk! If you have any questions or run into any issues, let us know by submitting a Github Issue! --- Contributors