Skip to main content

A library for validating files in Python

Project description

File Validator

https://img.shields.io/pypi/v/file_validator.svg?color=light Documentation Status made with python GitHub AppVeyor Codecov PyPI - Python Version https://static.pepy.tech/personalized-badge/file-validator?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=Downloads pylint CodeFactor https://raw.githubusercontent.com/rzashakeri/file_validator/master/file_validator.png

Features

If you are looking for a safe way to validate your files, the file validator library will do this for you, this library also supports Django.With this library you can validate files based on extension, size, mimes and magic numbers

  • File validation using the filetype library

  • File validation using the mimetypes library

  • File validation using the puremagic library

  • File validation with Size

  • Supporting for all mimes

  • File validation simultaneously with all four libraries

installation

To install File Validator, run this command in your terminal:

$ pip install file_validator

for windows:

$ pip install python-magic-bin

for Debian/Ubuntu:

$ sudo apt-get install libmagic1

for OSX:

When using Homebrew:

brew install libmagic

When using macports:

port install file

This is the preferred method to install File Validator, as it will always install the most recent stable release.

Documentation

  • Read the document for more information

Credits

This package was created By RezaShakeri

History

0.0.1 (2022-08-04)

  • First release on PyPI.

0.0.2 (2022-08-06)

  • Added django file validator

0.0.3 (2022-08-07)

  • Added File Validator With File Type Library

  • Added File Validator With Python Magic Library

0.0.4 (2022-08-07)

  • Added File Validator

0.0.5 (2022-08-08)

  • Added validator for pure python project

  • Added get_mime_type_with_python_magic function

  • Added get_extension_with_filetype_lib function

  • Added get_mime_type_with_filetype_lib function

  • Added file_validator_with_filetype_lib function

0.0.6 (2022-08-10)

  • Refactoring project files

0.0.7 (2022-08-10)

  • Adding Test To Project (file validator for pure python)

  • Deleting get_mime_type_with_python_magic

  • Deleting get_extension_with_filetype_lib

  • Deleting get_mime_type_with_filetype_lib

0.0.8 (2022-08-11)

  • Adding error message function for customization error messages

  • Adding constants.py

0.0.9 (2022-08-11)

  • Refactoring error message function

0.1.0 (2022-08-12)

  • Fixing Minor Bug

0.1.1 (2022-08-12)

  • Fixing python magic installation problem

0.1.2 (2022-08-14)

  • Fixing installation problem

0.1.3 (2022-08-14)

  • Adding installation guide for lib magic

0.1.4 (2022-08-15)

  • Refactoring imports

  • Refactoring error message

  • Adding __eq__ to class

  • Refactoring docstring

  • Error handling when the mime type not found

  • Adding the exception module

  • Adding constant error message

  • Refactor error_message function

  • Fix get the extension problem with the mimetypes library

0.1.5 (2022-08-18)

  • Adding File Size Validation

  • Adding File Validation using Pure Magic Library

  • Fix Minor Problem

0.1.6 (2022-08-23)

  • In this version of file validator, instead of considering a separate class for each library that we want to use for file validation, we considered a whole class and left it to the administrator to choose the library that is going to perform the validation operation. From one class, you can perform validation operations by one or more libraries

  • Adding Constants

  • Fix AttributeError When Mime Not Found

  • Fix Value Error When Selected One Mime

  • Fix Minor Problem

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

file_validator-0.1.6.tar.gz (11.6 kB view hashes)

Uploaded Source

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