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.2.tar.gz
(2.9 kB
view details)
File details
Details for the file checksumdir-1.1.2.tar.gz.
File metadata
- Download URL: checksumdir-1.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af70539048064513d29199c42c1f645028207a19c585b9453794f2070fb8606e
|
|
| MD5 |
7f62d4f2ebf6e160d78f09183ff79c1f
|
|
| BLAKE2b-256 |
7a0f1d80edbc0cd3faa75c6099512642232822ca73f0546477b4b7a72491aeeb
|