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
Metadata
Release files for pyntegrity 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyntegrity-1.3.0.tar.gz | 16.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyntegrity-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.0 kB
Release files / pyntegrity-1.3.0.tar.gz
| Download URL | pyntegrity-1.3.0.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff76236d7fb6fc75991a30e25bd22db3808dacd0ed59cc3996ca01c1e8559ac5
|
|
BLAKE2b-256 checksum How to use checksums |
32eb8cb5b0ff5a637116e8cf0d5a50fed87e31f7cac0dcbe6e4a893d28b8f8ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / pyntegrity-1.3.0-py3-none-any.whl
| Download URL | pyntegrity-1.3.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74a6ea12ed9c171a87972471bc6d99151c82186a14d341d4e3e612acf16dd111
|
|
BLAKE2b-256 checksum How to use checksums |
080b3b707730bce0b5db47f539a62c6a6393b1e8fd8cabc838deebe388aa395b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|