# Tach: Enforcing Python Dependencies with Modular Architecture

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/gauge-sh-tach
Generated for open source discovery and AI-assisted research.

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
OSRepos URL: https://osrepos.com/repo/gauge-sh-tach

## 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.

## Topics

- python
- rust
- dependency-management
- code-quality
- developer-tools
- monorepo
- cli
- open-source

## Repository Information

Last analyzed by OSRepos: Thu Feb 26 2026 12:25:37 GMT+0000 (Western European Standard Time)
Detail views: 1
GitHub clicks: 1

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

Tach 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.

Key capabilities of Tach include:
*   Enforcing that imports only originate from [declared dependencies](https://docs.gauge.sh/usage/configuration#modules){target="_blank"}.
*   Ensuring cross-module calls adhere to the [public interface](https://docs.gauge.sh/usage/configuration#interfaces){target="_blank"}.
*   Preventing [cycles](https://docs.gauge.sh/usage/configuration){target="_blank"} in the dependency graph.

Tach is highly adaptable, offering incremental adoption, no runtime impact, and seamless interoperability with existing systems.

## Installation

Getting started with Tach is straightforward. You can install it via pip:

bash
pip install tach


## Examples

### Project Setup

Tach provides an interactive command to guide you through the initial project setup. Run `tach init` to configure your module boundaries and source roots.

bash
tach init


### Dependency Enforcement

Once configured, use `tach check` to validate your project's dependencies against the defined rules. This command is ideal for integration into CI/CD pipelines.

bash
tach check


### Dependency Visualization

Visualize 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.

bash
tach show [--web]


### Detailed Reporting

To inspect dependencies and usages for a specific path or module, use the `tach report` command:

bash
tach report my_package/


Tach 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"}.

## Why Use Tach?

Tach 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.

## Links

*   **GitHub Repository:** [https://github.com/tach-org/tach](https://github.com/tach-org/tach){target="_blank"}
*   **Official Documentation:** [https://docs.gauge.sh](https://docs.gauge.sh){target="_blank"}