skillfed

checksumdir

Compute a single hash of the file contents of a directory.

checksumdir v1.3.0 769.4K downloads/30d#5,107 on PyPI102
Permissive license MIT AGING released

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 checksumdir

uv

uv add checksumdir

poetry

poetry add checksumdir

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Utilities

Tags

directory hash checksumcompute hash of folder contentsdirectory integrity verificationrecursive file hashexclude files from directory hashmd5 sha1 sha256 directory
file-integritycryptography

More Utilities packages