Skip to main content

DTach

downloads version license python basedpyright - checked ruff

Tach is a Python tool to enforce dependencies and interfaces, written in Rust.

Tach is inspired by the modular monolith architecture.

Docs

gauge-logo

https://github.com/user-attachments/assets/11eec4a1-f80a-4f13-9ff3-91a9760133b6

Tach can enforce:

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

uv add --dev dtach

pip

pip install dtach

Setup

Tach will guide you through initial project setup.

Run:

 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?

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:

tach check

You will see:

✅ 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
  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:

❌ 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, and VS Code, and more!

Extras

Visualize your dependency graph.

tach show [--web]

Tach will generate a graph of your dependencies. Here's what this looks like for Tach:

tach show

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 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:

tach report my_package/
# OR
tach report my_module.py

e.g.:

> 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:

More info in the docs. Tach logs anonymized usage statistics which can be opted out of. 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

Metadata

Release files for dtach 0.31.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dtach 0.31.2
File Size Uploaded
dtach-0.31.2.tar.gz 764.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for dtach 0.31.2
File
dtach-0.31.2-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
dtach-0.31.2-cp37-abi3-win32.whl CPython 3.7 abi3 Windows x86-32 Details
dtach-0.31.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
dtach-0.31.2-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.7 abi3 Linux glibc 2.17+ IBM System/390x Details
dtach-0.31.2-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.7 abi3 Linux glibc 2.17+ PowerPC 64-le Details
dtach-0.31.2-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-32 Details
dtach-0.31.2-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.7 abi3 Linux glibc 2.17+ ARMv7l Details
dtach-0.31.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.7 abi3 Linux glibc 2.17+ ARM64 Details
dtach-0.31.2-cp37-abi3-macosx_11_0_arm64.whl CPython 3.7 abi3 macOS 11.0+ ARM64 Details
dtach-0.31.2-cp37-abi3-macosx_10_12_x86_64.whl CPython 3.7 abi3 macOS 10.12+ x86-64 Details

Total release size: 41.7 MB

Release files / dtach-0.31.2.tar.gz

Download URL dtach-0.31.2.tar.gz
Size 764.7 kB
Tags Source
SHA-256 checksum
How to use checksums
87e6f1591eede62fbdbfb292ce98604a28706c6ac68b2b181dbf40795fdad912
BLAKE2b-256 checksum
How to use checksums
f6e1b2ceb1dd6ee9002cd5ab9684bfb24dbe3a10a036782d78cc99ad110135ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-win_amd64.whl

Download URL dtach-0.31.2-cp37-abi3-win_amd64.whl
Size 3.6 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9ce3388754f970170c11515c4a63d1841732cd11c99bde70aab2f48d6fce567a
BLAKE2b-256 checksum
How to use checksums
578bf57265422b6bdbd2c693780f666df07d25f63a2e7f3cfd2ed1f54a8922c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-win32.whl

Download URL dtach-0.31.2-cp37-abi3-win32.whl
Size 3.3 MB
Tags CPython 3.7 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
968d9bc50c5e58e7ff4c6856a35addcf5ff40ecb0c88648be056ac011d40fc44
BLAKE2b-256 checksum
How to use checksums
ecc24f43a3217d335cf52744215f79c41980e1eaded93db5dc2e7e94c4ed9f20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL dtach-0.31.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.3 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c0f6d86209517221d9e3116c5db8250ca44500de244d2d7640846c60ea473707
BLAKE2b-256 checksum
How to use checksums
2d7b3c3f694ba488fdeda3d3a12dbdea14e70c7064870ebcde1dbe744c185b8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL dtach-0.31.2-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 4.3 MB
Tags CPython 3.7 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
37268f714b8bd360b58081743ac5ef5b26680920f941968682a6f7ef1c0325b5
BLAKE2b-256 checksum
How to use checksums
70e6d6214e77eb18d9abfad5b492c6be3ae00ba4ab3875569218fb65e15309c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL dtach-0.31.2-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 5.0 MB
Tags CPython 3.7 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
046b6b51d7686369d9386529011315aceabde378d58ce679c08c4bd3864ecd32
BLAKE2b-256 checksum
How to use checksums
8101cf0d1797d61e165d0b5d6e5cd424ea95afedb8404511b64666786eeb6f06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL dtach-0.31.2-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Size 4.5 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
6bbef86b0097b64e95750a4767f2c35fc369ccbdd413bfd8152e112ddcd0c4fe
BLAKE2b-256 checksum
How to use checksums
1c5ad4a8704bee7adbc7d786cdd4818a7a82afac113d21da4ed2b5314b61f678
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL dtach-0.31.2-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 4.1 MB
Tags CPython 3.7 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
0bb617dbf0ed1a8f67d548daec2c46f21e736c5290322f6ab988178f48247ac4
BLAKE2b-256 checksum
How to use checksums
0c9b2d43552a28008f6265961ae2270cab5c6f79157121146bd1c6e65d89aabd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL dtach-0.31.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.1 MB
Tags CPython 3.7 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
200bab57752e1d794441b0d23d44cdf3be30e07f6e91c2cb2c97c777b5988ddc
BLAKE2b-256 checksum
How to use checksums
046a3399972816b141d3a6538a1ce44b1cc386a9806fa70385070c8d2ea26ec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-macosx_11_0_arm64.whl

Download URL dtach-0.31.2-cp37-abi3-macosx_11_0_arm64.whl
Size 3.8 MB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0f66170e8dfbd85843a0a00365eb1e41bde676c0bdb1dfac51065fbf15584ae3
BLAKE2b-256 checksum
How to use checksums
4374b654f93ae53206b583e9230f572a43ef27c706d8a640e2514501b6f9549e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release files / dtach-0.31.2-cp37-abi3-macosx_10_12_x86_64.whl

Download URL dtach-0.31.2-cp37-abi3-macosx_10_12_x86_64.whl
Size 4.0 MB
Tags CPython 3.7 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2063763476d80059ad124e70c10c5bd256cc77b219d1620be432832588000451
BLAKE2b-256 checksum
How to use checksums
4d23687e757c561ff058b6764f0a9b8ce72c06e017ea7cb2eb1d8f60b33b0bbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.7.1

Release history Release notifications | RSS feed

This release

0.31.2 This release

11 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page