Compute a single hash of the file contents of a directory.
Project description
A simple module for creating a single hash for a directory of files, with file contents; ignoring any metadata such as file name. Options exist to also exclude specific files or files with specific extensions.
Usage
from checksumdir import dirhash
directory = '/path/to/directory/'
md5hash = dirhash(directory, 'md5')
sha1hash = dirhash(directory, 'sha1', excluded_files=['package.json'])
sha256hash = dirhash(directory, 'sha256', excluded_extensions=['pyc'])
Or to use the CLI:
# Defaults to md5.
$ checksumdir /path/to/directory
# Create sha1 hash:
$ checksumdir -a sha1 /path/to/directory
# Exclude files:
$ checksumdir -e <files> /path/to/directory
# Exclude files with specific extensions:
$ checksumdir -x <extensions> /path/to/directory
# Follow soft links:
$ checksumdir --follow-links /path/to/directory
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
checksumdir-1.1.9.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for checksumdir-1.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9950807140fa7b5233a0b8bddae4b09ff7c018c1e7e01e2f7b4c766a00b461d8 |
|
MD5 | 88d994f94f5e6904aeee94f61a4567a9 |
|
BLAKE2b-256 | a3c4bf4ad152c96adadbaa9cad87e3a6a4fdff1540bf4342187763e9b3512d07 |