Skip to main content

Generate and validate checksums for files

Project description

File Checksum

Tests Status pre-commit.ci status Coverage PyPI version PyPI - Python Version

Generate checksums for files.

CVM requires that submitted data files include a checksum to verify the file has not changed. This program will generate those checksums for either a single file, or all the files in a directory.

Installation

Installation with pipx is recommended.

pipx install file-checksum

Alternatively the program can be installed with pip.

pip install file-checksum

Usage

Generate

  • Arguments
    • checksum_path: Path to the directory or file for which to generate checksums [required]
  • Options
    • --output-file, -o: Path to the file to same the checksums. Must be a .txt file. If no path is provided the output will be printed to the screen and not saved. [default: None]
    • --checksum-type, -c: The type of checksum to generate. Supported types are md5, sha1, and sha256. [default: sha256]
    • --verbose: Provides more output while running

Example

If we have the files my_file_1.xml and my_file_2.xml in the home/my_files directory, checksums can be generated for the files by running:

checksum /home/my_files -o /home/checksums.txt

The will create a file called checksums.txt in the /home directory containing the following information (hashes made up for example purposes)

sha256 checksum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - my_file_1.xml
sha256 checksum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - my_file_2.xml

Subsequent runs pointing to the same output file will append the results to the file so checksums from different directores can be save to the same file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file_checksum-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

file_checksum-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file file_checksum-1.0.0.tar.gz.

File metadata

  • Download URL: file_checksum-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Linux/5.15.0-1035-azure

File hashes

Hashes for file_checksum-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5fd3c61a1c01b59d3b94040f7a8b39d71d1fcf93348d12d4037615b4dd7907c6
MD5 09f2a2fafe63dea2cd8d73b6b59d97f7
BLAKE2b-256 64cfec381f006733cb3b9313584dfee04c2fafad3da1390f9832bfc06feb9c83

See more details on using hashes here.

File details

Details for the file file_checksum-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: file_checksum-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Linux/5.15.0-1035-azure

File hashes

Hashes for file_checksum-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebc753e20737b58ac554fbd93f6ecf80f94259b91f7a2c334e083e187fb3e0fc
MD5 bc1f85e7256c4786a216a75fd703083a
BLAKE2b-256 58b3dae3cf4961941737462fff4b49afdbbbbe2c383966645df69493d9ec54f2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page