Python module to create MD5 files for digital deliveries. Current version: 0.3.2
A project of the Digitization Program Office, OCIO, Smithsonian.
To install:
python3 -m pip install simd5
To upgrade add -U
:
python3 -m pip install -U simd5
To create a MD5 file with the filenames and hashes:
import simd5
simd5.md5_file(folder="files", fileformat="m f", no_workers=4)
The command can take these arguments:
folder
: Which folder to run in. Will ignore subfolders.fileformat
: What format to use when creating the MD5 file: **m f
:[MD5 hash] [filename]
(space-separated) **f m
:[filename] [MD5 hash]
(space-separated) **m,f
:[MD5 hash],[filename]
(comma-separated) **f,m
:[filename],[MD5 hash]
(comma-separated)no_workers
: How many parallel processes to use. By default, it will use the number of cores found in the system.
To verify if the files match a reference md5 file:
from simd5 import simd5
simd5.check_md5_file(md5_file="file.md5", files="*.tif*", csv=True, no_workers=4)
The command can take these arguments:
md5_file
: The file with the hash and filenamesfiles
: A search pattern for which files to compare the hashescsv
: Save the results to aresults.csv
fileno_workers
: How many parallel processes to use. By default, it will use the number of cores found in the system.
Available under the Apache License 2.0. Consult the LICENSE file for details.