tach-0.9.3
0.9.3
0.9.2
0.9.0
0.8.3
0.6.9
0.5.3
0.33.3
0.33.2
0.33.1
0.33.0
0.32.2
0.32.1
0.32.0
0.3.0
0.29.0
0.28.5
0.28.4
0.28.3
0.28.2
0.28.1
0.28.0
0.27.3
0.27.2
0.27.1
0.27.0
0.26.1
0.26.0
0.25.6
0.25.5
0.25.4
0.25.3
0.25.2
0.25.1
0.25.0
0.24.1
0.24.0
0.23.0
0.22.0
0.21.0
0.20.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.19.7
0.19.6
0.19.5
0.19.4
0.19.3
0.19.2
0.19.1
0.19.0
0.18.0
0.17.0
0.16.7
0.16.5
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.5
0.15.4
0.15.2
0.15.1
0.15.0
0.14.4
0.14.3
0.14.2
0.14.1
0.14.0
0.13.4
0.13.3
0.13.2
0.13.1
0.13.0
0.12.0
0.11.3
0.11.2
0.11.1
0.11.0
0.10.7
0.10.6
0.10.5
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.1.9
0.1.8
0.1.7
0.1.6
0.1.4
0.1.2
0.1.11
0.1.10
0.1.1
0.1.0
0.0.0
0.9.3
0.9.2
0.9.0
0.8.3
0.6.9
0.5.3
0.33.3
0.33.2
0.33.1
0.33.0
0.32.2
0.32.1
0.32.0
0.3.0
0.29.0
0.28.5
0.28.4
0.28.3
0.28.2
0.28.1
0.28.0
0.27.3
0.27.2
0.27.1
0.27.0
0.26.1
0.26.0
0.25.6
0.25.5
0.25.4
0.25.3
0.25.2
0.25.1
0.25.0
0.24.1
0.24.0
0.23.0
0.22.0
0.21.0
0.20.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.19.7
0.19.6
0.19.5
0.19.4
0.19.3
0.19.2
0.19.1
0.19.0
0.18.0
0.17.0
0.16.7
0.16.5
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.5
0.15.4
0.15.2
0.15.1
0.15.0
0.14.4
0.14.3
0.14.2
0.14.1
0.14.0
0.13.4
0.13.3
0.13.2
0.13.1
0.13.0
0.12.0
0.11.3
0.11.2
0.11.1
0.11.0
0.10.7
0.10.6
0.10.5
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.1.9
0.1.8
0.1.7
0.1.6
0.1.4
0.1.2
0.1.11
0.1.10
0.1.1
0.1.0
0.0.0
توضیحات
A Python tool to maintain a modular package architecture.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | tach-0.9.3 |
| نام | tach |
| نسخه کتابخانه | 0.9.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Caelean Barnes <caeleanb@gmail.com>, Evan Doyle <evanmdoyle@gmail.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/tach/ |
| مجوز | - |
# Tach
[](https://pepy.tech/project/tach)
[](https://pypi.Python.org/pypi/tach)
[](https://pypi.Python.org/pypi/tach)
[](https://pypi.Python.org/pypi/tach)
[](https://github.com/gauge-sh/tach/actions/workflows/ci.yml)
[](https://docs.basedpyright.com)
[](https://github.com/astral-sh/ruff)
Tach is a Python tool to enforce dependencies and interfaces, written in Rust.
Tach is inspired by the [modular monolith](https://www.milanjovanovic.tech/blog/what-is-a-modular-monolith) architecture.
[Docs](https://docs.gauge.sh)
<div align="center">
<img src="docs/assets/light_logo.png" alt="gauge-logo" width="30%" style="border-radius: 50%; padding-bottom: 20px"/>
</div>
https://github.com/user-attachments/assets/11eec4a1-f80a-4f13-9ff3-91a9760133b6
Tach can enforce:
- 📋 Imports only come from [declared dependencies](https://docs.gauge.sh/usage/configuration#modules)
- 🤝 Cross-module calls use the [public interface](https://docs.gauge.sh/usage/configuration#interfaces)
- ⛓️💥 [No cycles](https://docs.gauge.sh/usage/configuration) 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
```bash
pip install tach
```
### Setup
Tach will guide you through initial project setup.
Run:
```bash
tach init
```
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?](https://docs.gauge.sh/usage/faq#what-is-a-module%3F)
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](https://docs.gauge.sh/usage/configuration#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:
```bash
tach check
```
You will see:
```bash
✅ All modules validated!
```
You can validate that Tach is working by:
1. Removing an item from the `depends_on` key in `tach.toml`, or marking it as [deprecated](https://docs.gauge.sh/usage/deprecate)
2. By adding an import between modules that didn't previously import from each other.
Give both a try and run `tach check` again. This will generate an error:
```bash
❌ tach/check.py[L8]: Cannot use 'tach.filesystem'. Module 'tach' cannot depend on 'tach.filesystem'.
```
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, `tach check` will exit with a non-zero code. It can be easily integrated with CI/CD, [Pre-commit hooks](https://docs.gauge.sh/usage/commands#tach-install), and [VS Code](https://marketplace.visualstudio.com/items?itemName=detachhead.dtach), and more!
### Extras
Visualize your dependency graph.
```bash
tach show [--web]
```
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 `tach.toml` when running `tach show --web`.
If you would like to use the [GraphViz DOT format](https://graphviz.org/about/) locally, simply running `tach show` will generate `tach_module_graph.dot` in your working directory.
You can view the dependencies and usages for a given path:
```bash
tach report my_package/
# OR
tach report my_module.py
```
e.g.:
```bash
> tach report python/tach/filesystem
[Dependencies of 'python/tach/filesystem']
python/tach/filesystem/install.py[L6]: Import 'tach.hooks.build_pre_commit_hook_content'
python/tach/filesystem/project.py[L5]: Import 'tach.constants.CONFIG_FILE_NAME'
...
-------------------------------
[Usages of 'python/tach/filesystem']
python/tach/cache/access.py[L8]: Import 'tach.filesystem.find_project_config_root'
python/tach/cache/setup.py[L7]: Import 'tach.filesystem.find_project_config_root'
...
```
Tach also supports:
- [Public interfaces for modules](https://docs.gauge.sh/usage/interfaces/)
- [Deprecating individual dependencies](https://docs.gauge.sh/usage/deprecate)
- [Layered architecture](https://docs.gauge.sh/usage/layers)
- [Incremental adoption](https://docs.gauge.sh/usage/unchecked-modules)
- [Generating JSON dependency maps](https://docs.gauge.sh/usage/commands#tach-map)
- [Monorepos and namespace packages](https://docs.gauge.sh/usage/configuration#source-roots)
- [Domain ownership](https://docs.gauge.sh/usage/configuration#tach-domain-toml)
- [Inline 'ignore' comments](https://docs.gauge.sh/usage/tach-ignore)
- [Pre-commit hooks](https://docs.gauge.sh/usage/commands#tach-install)
More info in the [docs](https://docs.gauge.sh/). 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](https://github.com/gauge-sh/tach/issues)!
---
### Contributors
<a href="https://github.com/gauge-sh/tach/graphs/contributors">
<img src="https://contrib.rocks/image?repo=gauge-sh/tach" />
</a>
نیازمندی
| مقدار | نام |
|---|---|
| - | pyyaml~=6.0 |
| - | tomli>=1.2.2 |
| - | tomli-w~=1.0 |
| - | rich>=13.0 |
| - | prompt-toolkit~=3.0 |
| - | gitpython~=3.1 |
| - | networkx<4.0,>=2.6 |
| - | pydot<5,>=2 |
| ython_full_versio | stdlib-list>=0.10.0; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl tach-0.9.3:
pip install tach-0.9.3.whl
نصب پکیج tar.gz tach-0.9.3:
pip install tach-0.9.3.tar.gz