A CLI tool to verify file hashes
Project description
Python PGP Check
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
- Create a virtual environment:
# On Windows
python -m venv venv
# On macOS/Linux
python3 -m venv venv
- Activate the virtual environment:
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
Installation Options
Option 1: Development Installation
- Install dependencies:
pip install -r requirements.txt
- Run the CLI directly for testing:
python src/pgp_check/cli.py
Option 2: Package Installation
- 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
deactivateto 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_pgp_check-0.3.2.tar.gz.
File metadata
- Download URL: python_pgp_check-0.3.2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa65827f4539b7b2c61a0d610048692ddf80a64f6bf10adb0da6bbb655428294
|
|
| MD5 |
4e6ecc9014712957f37af9b35a65ef1c
|
|
| BLAKE2b-256 |
a50928d16f8a8a0e784b1a7091410c2dfbef2e3f1b3e5dd7372f8e29d754a62e
|
File details
Details for the file python_pgp_check-0.3.2-py3-none-any.whl.
File metadata
- Download URL: python_pgp_check-0.3.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc0682e78798ce467aa75887efeace2af543c6bc48b5dd6fd64eb29128ac0a5c
|
|
| MD5 |
65a147a7a4a858b4adacab1b1f3f566e
|
|
| BLAKE2b-256 |
b0540553b30721b078dbceb496cf85c0e90a9d719a3f31bfe478a3f34a5fb4e0
|