Skip to main content

A CLI tool to verify file hashes

Project description

Python PGP Check

PyPI Version PyPI Downloads

License Format Implementation Package Size

A quick python CLI tool to verify file PGP hashes

Installation and usage

Install it with python pip using

pip install python-pgp-check

Usage

Calculate Hash

to calculate the hash of a file:

python-pgp-check <file_path>

Verify Hash

To verify a file against an expected hash:

python-pgp-check <file_path> <expected_hash>

Specifying Hash Algorithm

By default, SHA-256 is used. To use a different algorithm:

python-pgp-check <file_path> [<expected_hash>] --algorithm <algorithm>

Supported algorithms: md5, sha1, sha256, sha512

Examples

Calculate SHA-256 hash:

python-pgp-check /path/to/file

Verify file with SHA-256 hash:

python-pgp-check /path/to/file 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8

Calculate MD5 hash:

python-pgp-check /path/to/file --algorithm md5

Verify file with SHA-512 hash:

python-pgp-check /path/to/file 3c9909afec25354d551dae21590bb26e38d53f2173b8d3dc3eee4c047e7ab1c1eb8b85103e3be7ba613b31bb5c9c36214dc9f14a42fd7a2fdb84856bca5c44c2 --algorithm sha512

Dev Setup

  1. Create a virtual environment:
# On Windows
python -m venv venv

# On macOS/Linux
python3 -m venv venv
  1. Activate the virtual environment:
# On Windows
venv\Scripts\activate

# On macOS/Linux
source venv/bin/activate

Installation Options

Option 1: Development Installation

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the CLI directly for testing:
python src/pgp_check/cli.py

Option 2: Package Installation

  1. Install the package in editable mode:
pip install -e .

Verification

Test the it installed correctly:

# If installed with Option 2
python-pgp-check --version

Notes

  • Always ensure your virtual environment is activated before running commands (you should see (venv) in your terminal prompt)
  • Use deactivate to exit the virtual environment when done
  • If you encounter permission errors, you may need to use sudo (Linux/macOS) or run as administrator (Windows)

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

python_pgp_check-0.3.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_pgp_check-0.3.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file python_pgp_check-0.3.1.tar.gz.

File metadata

  • Download URL: python_pgp_check-0.3.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for python_pgp_check-0.3.1.tar.gz
Algorithm Hash digest
SHA256 dc8b5aeb9beb7bcf431640beabed81af735da7ea27fc7c8e3d74d5f02e40f7c4
MD5 be0055f0162e2050f20003d26161956d
BLAKE2b-256 55ef00d5dc6b78d797b228da18af07e79cc39120dd843cfa9a663cefe95eef8e

See more details on using hashes here.

File details

Details for the file python_pgp_check-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_pgp_check-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 355282d89ef37464cfb2e5872b2f1ed31f315e4d71a305895d1f0868b2650af7
MD5 21446c22549e4afa63d33676769e00a1
BLAKE2b-256 cb16fbfa15bff15e3d88d9eff447733d55a02009191105e484c3c44436124b9f

See more details on using hashes here.

Supported by

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