Validation for local and upload file
Project description
Python File Verifier
About File Verifier
File Verifier is file validate library for python. It provides method to verify local and upload file
Install
$ pip install file-verifier
Usage
from file_verifier.mime.magic_async_mime import MagicAsyncValidatorMime
from file_verifier.size.basic_async_size import BaseAsyncValidatorSize
from file_verifier.type.filetype_type import FiletypeValidatorType
from file_verifier.convertor.pillow_convertor import PillowConvertor
from file_verifier.file_validator import FileValidator
mime_validator = MagicAsyncValidatorMime(acceptable_mimes=["image/jpeg"])
size_validator = BaseAsyncValidatorSize(max_upload_file_size=1024 * 1024)
type_validator = FiletypeValidatorType(acceptable_types=["image"])
file_convertor = PillowConvertor(acceptable_mimes=["image/jpeg"])
obj_validator = FileValidator(mime_validator, size_validator, type_validator, file_convertor)
obj_validator.validate_file("/tmp/hello.txt")
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
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
file-verifier-0.0.0.tar.gz
(6.5 kB
view details)
Built Distribution
File details
Details for the file file-verifier-0.0.0.tar.gz
.
File metadata
- Download URL: file-verifier-0.0.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d005ffa2843e6660486f7df5808821316df591e7fc1e771309c8306a1a0d336 |
|
MD5 | c8355e19b68619bb314b18cf8bd3e984 |
|
BLAKE2b-256 | c6b18d3e5845462a08c8b3520ae5d9eca7127e5b199580d8c8767c51524432b5 |
File details
Details for the file file_verifier-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: file_verifier-0.0.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ecf1195ef203cb77b7789e242301d55b2d96fd2fd1ecfbe5fd8013d756f9bff |
|
MD5 | 61a3ff99a3ab9adb3ca17dea3068c120 |
|
BLAKE2b-256 | 3065733c15e1a9b34196fc5dccf0f05d61fa6df262ba0ce0bb3c77a46b34850c |