{"name":"Tach: Enforcing Python Dependencies with Modular Architecture","description":"Tach is an open-source Python tool, written in Rust, designed to visualize and enforce dependencies within your projects. It promotes modular architecture by ensuring declared dependencies, public interfaces, and preventing dependency cycles. Installable via pip, Tach offers incremental adoption and no runtime impact.","github":"https://github.com/gauge-sh/tach","url":"https://osrepos.com/repo/gauge-sh-tach","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/gauge-sh-tach","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/gauge-sh-tach.md","json":"https://osrepos.com/repo/gauge-sh-tach.json","topics":["python","rust","dependency-management","code-quality","developer-tools","monorepo","cli","open-source"],"keywords":["python","rust","dependency-management","code-quality","developer-tools","monorepo","cli","open-source"],"stars":null,"summary":"Tach is an open-source Python tool, written in Rust, designed to visualize and enforce dependencies within your projects. It promotes modular architecture by ensuring declared dependencies, public interfaces, and preventing dependency cycles. Installable via pip, Tach offers incremental adoption and no runtime impact.","content":"## Introduction\n\nTach is an open-source Python tool, implemented in Rust, designed to help developers visualize and enforce dependencies within their projects. Inspired by the modular monolith architecture, Tach ensures a clean and maintainable codebase by defining clear boundaries and rules.\n\nKey capabilities of Tach include:\n*   Enforcing that imports only originate from [declared dependencies](https://docs.gauge.sh/usage/configuration#modules){target=\"_blank\"}.\n*   Ensuring cross-module calls adhere to the [public interface](https://docs.gauge.sh/usage/configuration#interfaces){target=\"_blank\"}.\n*   Preventing [cycles](https://docs.gauge.sh/usage/configuration){target=\"_blank\"} in the dependency graph.\n\nTach is highly adaptable, offering incremental adoption, no runtime impact, and seamless interoperability with existing systems.\n\n## Installation\n\nGetting started with Tach is straightforward. You can install it via pip:\n\nbash\npip install tach\n\n\n## Examples\n\n### Project Setup\n\nTach provides an interactive command to guide you through the initial project setup. Run `tach init` to configure your module boundaries and source roots.\n\nbash\ntach init\n\n\n### Dependency Enforcement\n\nOnce configured, use `tach check` to validate your project's dependencies against the defined rules. This command is ideal for integration into CI/CD pipelines.\n\nbash\ntach check\n\n\n### Dependency Visualization\n\nVisualize your project's dependency graph with `tach show`. The `--web` flag generates an interactive web-based graph, or you can generate a local GraphViz DOT file.\n\nbash\ntach show [--web]\n\n\n### Detailed Reporting\n\nTo inspect dependencies and usages for a specific path or module, use the `tach report` command:\n\nbash\ntach report my_package/\n\n\nTach also supports a range of advanced features, including [public interfaces for modules](https://docs.gauge.sh/usage/interfaces/){target=\"_blank\"}, [deprecating individual dependencies](https://docs.gauge.sh/usage/deprecate){target=\"_blank\"}, [layered architecture](https://docs.gauge.sh/usage/layers){target=\"_blank\"}, [incremental adoption for unchecked modules](https://docs.gauge.sh/usage/unchecked-modules){target=\"_blank\"}, [generating JSON dependency maps](https://docs.gauge.sh/usage/commands#tach-map){target=\"_blank\"}, and [integration with pre-commit hooks](https://docs.gauge.sh/usage/commands#tach-install){target=\"_blank\"}.\n\n## Why Use Tach?\n\nTach empowers development teams to maintain robust and scalable Python applications by enforcing architectural discipline. By preventing common issues like tangled dependencies and hidden interfaces, it significantly improves code quality, reduces technical debt, and streamlines onboarding for new team members. Its Rust implementation ensures high performance, while its incremental adoption strategy makes it easy to integrate into existing large-scale projects without disruption.\n\n## Links\n\n*   **GitHub Repository:** [https://github.com/tach-org/tach](https://github.com/tach-org/tach){target=\"_blank\"}\n*   **Official Documentation:** [https://docs.gauge.sh](https://docs.gauge.sh){target=\"_blank\"}","metrics":{"detailViews":1,"githubClicks":1},"dates":{"published":null,"modified":"2026-02-26T12:25:37.000Z"}}