Skip to main content

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.

master workflow

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


Download files

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

Source Distribution

pyntegrity-1.3.0.tar.gz (16.4 kB view hashes)

Uploaded Source

Built Distribution

pyntegrity-1.3.0-py3-none-any.whl (18.6 kB view hashes)

Uploaded Python 3

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