checksumdir
Compute a single hash of the file contents of a directory.
What it is and what it does
Checksumdir is a lightweight utility that generates a single hash digest representing all file contents within a directory tree. It ignores file and directory metadata—only the actual file content matters—making it useful for detecting whether the substantive content of a directory has changed, independent of timestamps or file names. The package works as both a Python library (via the dirhash function) and a command-line tool, supporting multiple hash algorithms (md5, sha1, sha256) and offering fine-grained control over which files to include or exclude.
The module has no runtime dependencies and supports Python 3.9 through 3.13. It's straightforward to integrate into build pipelines, testing frameworks, or any workflow where you need to verify that directory contents haven't been altered. The aging maintenance status (last release 364 days ago) suggests stability rather than active development, and the absence of known vulnerabilities indicates it's safe to use.
Use it for:
- Verify that cached build artifacts or downloaded packages haven't been corrupted or modified
- Detect changes in source code directories for incremental build systems or CI/CD pipelines
- Compare directory contents across machines or time periods without relying on file timestamps
- Exclude temporary or generated files (e.g., .pyc, node_modules) when computing integrity hashes
- Implement simple content-based deduplication or change detection in file synchronization tools
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes a single hash digest of all file contents in a directory, with options to exclude specific files or extensions, and ignore file metadata like names.
Yes. Checksumdir solves a specific, well-defined problem with zero dependencies, permissive licensing, and no known vulnerabilities. Install it if you need to hash directory contents for integrity checking or change detection. The aging maintenance is not a concern—the code is stable and the last commit was recent. Not worth installing if you need active feature development or extensive documentation.
Install
checksumdir on PyPI
pip
pip install checksumdiruv
uv add checksumdirpoetry
poetry add checksumdirInstalling checksumdir
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last release was 364 days ago, though the repository remains active with a recent commit on 2025-08-15 and modest community interest (102 stars).
License in practice
MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for most projects.
Quickstart
pip install checksumdir
from checksumdir import dirhash
md5hash = dirhash('/path/to/directory', 'md5')
sha256hash = dirhash('/path/to/directory', 'sha256', excluded_extensions=['pyc'])
Verify before relying
- Whether the package handles symlinks correctly by default or only with the --follow-links flag
- Performance characteristics on very large directories or deeply nested structures
- Whether excluded_files and excluded_extensions can be combined in a single call
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 364 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 769,406/month — #5,107 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: checksumdir-1.3.0-py3-none-any.whl
Keywords: hash, checksum, md5, directory
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
dirhashComputes a single hash value for an entire…
permissive · top 5,000 on PyPI
poochPooch downloads files from HTTP, FTP, and data…
permissive · top 5,000 on PyPI
setuptools-downloadA setuptools plugin that downloads external…
permissive · top 5,000 on PyPI
filehashCalculates and verifies file checksums and…
permissive · top 15,000 on PyPI
bagitCreate, validate, and manage BagIt-style…
permissive · top 15,000 on PyPI
hashringImplements consistent hashing in Python using…
permissive · top 15,000 on PyPI
dict-hashGenerates consistent hashes for Python…
permissive · top 15,000 on PyPI
py-multihashEncodes and decodes multihash digests,…
permissive · top 15,000 on PyPI
xxhashxxhash provides fast non-cryptographic hashing…
permissive · top 1,000 on PyPI
siphashProvides a Python implementation of SipHash, a…
permissive · top 15,000 on PyPI