Pyntegrity is a Python package that helps you check a file integrity.
Project description
Pyntegrity
Pyntegrity is Python package that helps you check a file integrity.
Supported Python versions
Tested on:
- Python 3.7
- Python 3.8
- Python 3.9
- Python 3.10
Documentation
Latest version is 1.2.0
Installation
To install Pyntegrity use pip:
pip install pyntegrity
Supported features
Checksum algorithms
The supported checksum algorithms are:
- md5
- sha256
- sha512
Target files sizes
For now mostly small files since it loads the whole file in memory to calculate its checksum
How to use
In your program import the class IntegrityValidator:
from pyntegrity.core import IntegrityValidator
Initialize it with the target file and the expected checksum (it automatically detects which checksum algorithm to use), example:
obj = IntegrityValidator(
str_path="my_file.txt",
checksum_str="my_checksum",
)
Then use the function validate_file_integrity to check the file integrity,
it returns True if the target file checksum equal the one passed in the class constructor,
if else it returns False, example:
status = obj.validate_file_integrity()
Side note
Right now it will open anyfile in text mode (even binary).
Future features
- Support more file type modes
- Support more checksum algorithms
- Support for big files
License
GPL-3.0 see license content
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 pyntegrity-1.3.0.tar.gz.
File metadata
- Download URL: pyntegrity-1.3.0.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff76236d7fb6fc75991a30e25bd22db3808dacd0ed59cc3996ca01c1e8559ac5
|
|
| MD5 |
97225981b3d58cff5865b00e78490525
|
|
| BLAKE2b-256 |
32eb8cb5b0ff5a637116e8cf0d5a50fed87e31f7cac0dcbe6e4a893d28b8f8ca
|
File details
Details for the file pyntegrity-1.3.0-py3-none-any.whl.
File metadata
- Download URL: pyntegrity-1.3.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74a6ea12ed9c171a87972471bc6d99151c82186a14d341d4e3e612acf16dd111
|
|
| MD5 |
206fe50a47712fa291ef44f0c2d92bb5
|
|
| BLAKE2b-256 |
080b3b707730bce0b5db47f539a62c6a6393b1e8fd8cabc838deebe388aa395b
|