Skip to main content

Tach

downloads version license python ci 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

pip install tach

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tach-0.35.1.tar.gz (733.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tach-0.35.1-cp37-abi3-win_amd64.whl (3.7 MB view details)

Uploaded CPython 3.7+Windows x86-64

tach-0.35.1-cp37-abi3-win32.whl (3.4 MB view details)

Uploaded CPython 3.7+Windows x86

tach-0.35.1-cp37-abi3-musllinux_1_2_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ x86-64

tach-0.35.1-cp37-abi3-musllinux_1_2_ppc64le.whl (5.4 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ppc64le

tach-0.35.1-cp37-abi3-musllinux_1_2_i686.whl (4.6 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ i686

tach-0.35.1-cp37-abi3-musllinux_1_2_armv7l.whl (4.5 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARMv7l

tach-0.35.1-cp37-abi3-musllinux_1_2_aarch64.whl (4.5 MB view details)

Uploaded CPython 3.7+musllinux: musl 1.2+ ARM64

tach-0.35.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

tach-0.35.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (4.3 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ s390x

tach-0.35.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (5.3 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ppc64le

tach-0.35.1-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (4.6 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ i686

tach-0.35.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (4.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARMv7l

tach-0.35.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ ARM64

tach-0.35.1-cp37-abi3-macosx_11_0_arm64.whl (4.0 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

tach-0.35.1-cp37-abi3-macosx_10_12_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.7+macOS 10.12+ x86-64

File details

Details for the file tach-0.35.1.tar.gz.

File metadata

  • Download URL: tach-0.35.1.tar.gz
  • Upload date:
  • Size: 733.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.1

File hashes

Hashes for tach-0.35.1.tar.gz
Algorithm Hash digest
SHA256 72a30df29fcf6cfef4cf145447eef23c1432377594d37b0b28ab195e11ccfe64
MD5 60ecd1dae15eff38ddccaaf20bf98a35
BLAKE2b-256 f366d5b253c9e846a2de009d14fbf3fa352a2f8fe74d0184ae3dbe453772f2fa

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: tach-0.35.1-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.7 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.1

File hashes

Hashes for tach-0.35.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5b153fdc159306dbc1443a099973e7f15c5a4bc564865a36a47217edd24ab0f4
MD5 b59134edf15d3b208a9416588eeca80c
BLAKE2b-256 4ee1e8959ee0f771cb8e32bd10a9f4258cc3f08a359cf54b7ebc36fea445c14c

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-win32.whl.

File metadata

  • Download URL: tach-0.35.1-cp37-abi3-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.7+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.1

File hashes

Hashes for tach-0.35.1-cp37-abi3-win32.whl
Algorithm Hash digest
SHA256 6888312a598da48e24b89d272397bb357a93e1312767d2c4b7e75abdc43d924f
MD5 e57025168464af2f1b1f1a07947fc852
BLAKE2b-256 3971d1e483360ef95fa1e067f1c86ab269a27f11ad801276d16d5bfb09ab7974

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e7ff352cfc4bd627720cc3c9cbf0dd930d5e740306cd3c87b4519604b1b2349d
MD5 f9431012e9090fe72a1171b918718da0
BLAKE2b-256 b95754a3c4d0cda115e3f769c45d844c9e12b404ff2a1171ed152a20f253ea1e

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-musllinux_1_2_ppc64le.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-musllinux_1_2_ppc64le.whl
Algorithm Hash digest
SHA256 2f6548c9c1cc232f0ba35a08e7b2c24b3d0e2f0d51392dbe0bd0e37c088f1775
MD5 625b78c4559023e5e85112e9b64f9bbe
BLAKE2b-256 609c1248ddb7bfad9e0b6194a158d7c00e1a9ba97fa4c8c13329de052a0582d2

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 00eedc986fd7cdab9a169964f3dd73aa8ac89dd6f1e91e59c3b3851a3d589cff
MD5 9f33da826e5c085cae5c0c81e61351a7
BLAKE2b-256 ef4605a52ffddfd1dc402c71a4e3347b5cf1b72bf7f46a90e88b7293b3673466

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 d9ebe880217101a8b984a1aa19487462320ba5d89bae5961a50d1b830b7d0d9b
MD5 3f687d2e2c3f88da5838116f070005bb
BLAKE2b-256 405e50336da6289da448e0dc958d861edddd6529d749b869570f3071c3260a9b

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 40f6a24244b0a8593a8030c5a4a7ceeddaafca763c03e47750dfaed30466666d
MD5 43ef6cf5b7a3086607d06ee4a3c3030f
BLAKE2b-256 210bdf8e0801a4a8fcb5231bf8539ba42801946ce24043410aa4e244a312d8d5

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3765c38fb8608c81411a2a5399d1225a250e61dd4890bd4a1b725104af65a0cb
MD5 2e985245d34263e8a082f12294ebd2b9
BLAKE2b-256 ec5499aa72a2f72a9682b1e2f8b75e8fe2a17c6f78556c156cad11f3cf12c139

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 c29d57de5b247c42544af135fa62536db6e5bad5891793a5756ed6563e1edf76
MD5 d800d47e771a02cbdb526f7b2a0c13a4
BLAKE2b-256 8195b4e3234c63e3b3b41f1fc3a7cefef56c3e1ae196c2a1112f23ca4686f338

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 b5e263401ab7718ed5cd7027615557023ce01c96ab2fd892ca2ed3f517299b13
MD5 d9f4cc743bc208a8a6b7be88ab22d66b
BLAKE2b-256 9e64ee9b750191e6bf43e34a468f74a2f30090ec1339f0fcf63bcd8e357bc284

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 db255b02a23191313544ce8fb027ca886d21eca9185dd8a2a3724b0ada098cd9
MD5 2952231d727d5e226b4ee836d37fcb1a
BLAKE2b-256 380cc47a60dbbc60f1f9c5e5d88d0e5b03e7ffbebb64af8b731bbd4b2a06f02e

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 5e058235503560414abdcabe4ab3f1311b0af6fbf29fee2aad1ffe1b68b084cc
MD5 e25227d8198e016d44ffe90f2691e3b3
BLAKE2b-256 248b95185f077bac5c748786401f928f93b301158cfc0f5cd22f3deff72a2c49

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 898cf75fd0801359bf8ec97a98057234bdb03ee71f95fd5b23e2a9a7e9bd9584
MD5 cc3583f2e081fdf181318053517bbe78
BLAKE2b-256 c9867b3b69bc7cfec8495fb153daa6eda92218b1b79a223a0f245095373e2786

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 586891d8a4a963b87c3120aaf1872300065b169655f537b87b94bb2dca39b2d1
MD5 0fb811fa9734a102298edba72c5b6af2
BLAKE2b-256 64c632f14b791f95dc9b4de09a369257bfc851962a29ad498e5cd24f34febe83

See more details on using hashes here.

File details

Details for the file tach-0.35.1-cp37-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tach-0.35.1-cp37-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f1bd7c24e3df8fe7254ac543acb04ae7b016f6f7b25e731e3746a2d505932e18
MD5 14f088bff63946135c52aa3de3d4d932
BLAKE2b-256 8d0095a1b96312854e65782a43c3a86b03417916f83466c73432cd646f23b859

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.35.1 This release

16 files

0.35.0

16 files

0.34.1

18 files

0.34.0

18 files

0.33.4

18 files

0.33.3

18 files

0.33.2

18 files

0.33.1

18 files

0.33.0

18 files

0.32.2

18 files

0.32.1

13 files

0.32.0

13 files

0.29.0

11 files

0.28.5

11 files

0.28.4

11 files

0.28.3

11 files

0.28.2

11 files

0.28.1

11 files

0.28.0

11 files

0.27.3

11 files

0.27.2

11 files

0.27.1

11 files

0.27.0

11 files

0.26.1

11 files

0.26.0

11 files

0.25.6

11 files

0.25.5

11 files

0.25.4

11 files

0.25.3

11 files

0.25.2

11 files

0.25.1

11 files

0.25.0

11 files

0.24.1

11 files

0.24.0

11 files

0.23.0

11 files

0.22.0

11 files

0.21.0

11 files

0.20.0

11 files

0.19.7

11 files

0.19.6

11 files

0.19.5

11 files

0.19.4

11 files

0.19.3

11 files

0.19.2

11 files

0.19.1

11 files

0.19.0

11 files

0.18.0

11 files

0.17.0

11 files

0.16.7

93 files

0.16.5

93 files

0.16.4

93 files

0.16.3

93 files

0.16.2

93 files

0.16.1

93 files

0.16.0

93 files

0.15.5

93 files

0.15.4

79 files

0.15.2

79 files

0.15.1

79 files

0.15.0

79 files

0.14.4

79 files

0.14.3

79 files

0.14.2

79 files

0.14.1

81 files

0.14.0

81 files

0.13.4

81 files

0.13.3

81 files

0.13.2

81 files

0.13.1

81 files

0.13.0

81 files

0.12.0

81 files

0.11.3

81 files

0.11.2

81 files

0.11.1

81 files

0.11.0

81 files

0.10.7

81 files

0.10.6

81 files

0.10.5

81 files

0.10.4

81 files

0.10.3

81 files

0.10.2

81 files

0.10.1

81 files

0.10.0

81 files

0.9.3

81 files

0.9.2

81 files

0.9.0

81 files

0.8.3

81 files

0.6.9

65 files

0.5.3

67 files

0.3.0

67 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.4

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.0

2 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