filehash
Module and command-line tool that wraps around hashlib and zlib to facilitate generating checksums / hashes of files and directories.
What it is and what it does
Filehash is a Python module that wraps hashlib and zlib to compute and verify file checksums and hashes. It provides a FileHash class with methods to hash individual files, multiple files, or entire directories, and to verify checksums against SFV files or checksum files in the format used by sha1sum and similar tools. It also includes a command-line tool, chkfilehash, for quick hash computation and verification from the shell.
The package supports multiple hashing algorithms—MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, BLAKE2b, BLAKE2s, CRC32, and Adler-32—and allows configuration of the hash algorithm and chunk size for memory-efficient processing of large files. It has no external runtime dependencies and works across Python 2.7 and Python 3.6 through 3.10.
Use it for:
- Verify file integrity after download or transfer by comparing computed hashes against expected checksums.
- Batch-process directories to generate hash manifests for archival or backup verification.
- Validate SFV files to check that a set of downloaded files match their original checksums.
- Compute a combined hash for multiple files sorted by their individual hashes for deduplication or integrity checks.
- Integrate file hashing into Python scripts without external dependencies for lightweight integrity validation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Calculates and verifies file checksums and hashes using algorithms like MD5, SHA-1, SHA-2, BLAKE2, CRC32, and Adler-32, with support for single files, multiple files, and entire directories.
Yes, if you need lightweight file hashing without external dependencies and don't require active maintenance. The core functionality is stable and well-tested across multiple Python versions. No, if you need ongoing support, bug fixes, or compatibility with Python versions beyond 3.10—the project is dormant and has not been updated since 2021.
Install
filehash on PyPI
pip
pip install filehashuv
uv add filehashpoetry
poetry add filehashInstalling filehash
Before you install
Low install friction with no runtime dependencies. Maintenance is dormant—last release was in 2021 and last commit in March 2024—so expect no active bug fixes or feature updates, though the package remains functional for its core use case.
License in practice
MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install filehash
from filehash import FileHash
md5hasher = FileHash('md5')
md5hasher.hash_file("./testdata/lorem_ipsum.txt")
Verify before relying
- Whether BLAKE2 support on Python 3.6+ is still functional in practice given the dormant maintenance status.
- Current compatibility with Python versions beyond 3.10, which was the latest tested version listed in the description.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,768 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 749,392/month — #5,162 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: filehash-0.2.dev1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
dict-hashGenerates consistent hashes for Python…
permissive · top 15,000 on PyPI
dirhashComputes a single hash value for an entire…
permissive · top 5,000 on PyPI
paytmchecksumGenerates and verifies checksums for Paytm…
permissive · top 15,000 on PyPI
py-multihashEncodes and decodes multihash digests,…
permissive · top 15,000 on PyPI
checksumdirComputes a single hash digest of all file…
permissive · top 15,000 on PyPI
commoncodeCommonCode provides utility functions for…
unclear · top 15,000 on PyPI
lpc-checksumCalculates LPC firmware checksums for embedded…
permissive · top 15,000 on PyPI
ImageHashImageHash computes perceptual fingerprints of…
permissive · top 5,000 on PyPI
django-sriGenerates Subresource Integrity (SRI) hashes…
permissive · top 15,000 on PyPI
fastcrcfastcrc computes CRC checksums (8, 16, 32, and…
permissive · top 5,000 on PyPI