# Python File Verifier
[![Testing](https://github.com/rabiloo/python-file-verifier/actions/workflows/test.yml/badge.svg)](https://github.com/rabiloo/python-file-verifier/actions/workflows/test.yml)
[![Latest Version](https://img.shields.io/pypi/v/file-verifier.svg)](https://pypi.org/project/file-verifier)
[![Downloads](https://img.shields.io/pypi/dm/file-verifier.svg)](https://pypi.org/project/file-verifier)
[![Pypi Status](https://img.shields.io/pypi/status/file-verifier.svg)](https://pypi.org/project/file-verifier)
[![Python Versions](https://img.shields.io/pypi/pyversions/file-verifier.svg)](https://pypi.org/project/python-file-verifier)
## About File Verifier
[File Verifier](https://github.com/rabiloo/python-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](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Dao Quang Duy](https://github.com/duydq12)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.
Raw data
{
"_id": null,
"home_page": "",
"name": "file-verifier",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Rabiloo Developers <oss@rabiloo.com>",
"keywords": "file-verifier,file-validator,filetype,magic,mimetypes,puremagic,Pillow",
"author": "",
"author_email": "Dao Quang Duy <duydaoquang12@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c6/b1/8d3e5845462a08c8b3520ae5d9eca7127e5b199580d8c8767c51524432b5/file-verifier-0.0.0.tar.gz",
"platform": null,
"description": "# Python File Verifier\n\n[![Testing](https://github.com/rabiloo/python-file-verifier/actions/workflows/test.yml/badge.svg)](https://github.com/rabiloo/python-file-verifier/actions/workflows/test.yml)\n[![Latest Version](https://img.shields.io/pypi/v/file-verifier.svg)](https://pypi.org/project/file-verifier)\n[![Downloads](https://img.shields.io/pypi/dm/file-verifier.svg)](https://pypi.org/project/file-verifier)\n[![Pypi Status](https://img.shields.io/pypi/status/file-verifier.svg)](https://pypi.org/project/file-verifier)\n[![Python Versions](https://img.shields.io/pypi/pyversions/file-verifier.svg)](https://pypi.org/project/python-file-verifier)\n\n## About File Verifier\n\n[File Verifier](https://github.com/rabiloo/python-file-verifier) is file validate library for python. It provides method to verify local and upload file\n\n## Install\n\n```\n$ pip install file-verifier\n```\n\n## Usage\n\n```\nfrom file_verifier.mime.magic_async_mime import MagicAsyncValidatorMime\nfrom file_verifier.size.basic_async_size import BaseAsyncValidatorSize\nfrom file_verifier.type.filetype_type import FiletypeValidatorType\nfrom file_verifier.convertor.pillow_convertor import PillowConvertor\nfrom file_verifier.file_validator import FileValidator\n\n\nmime_validator = MagicAsyncValidatorMime(acceptable_mimes=[\"image/jpeg\"])\nsize_validator = BaseAsyncValidatorSize(max_upload_file_size=1024 * 1024)\ntype_validator = FiletypeValidatorType(acceptable_types=[\"image\"])\nfile_convertor = PillowConvertor(acceptable_mimes=[\"image/jpeg\"])\n\nobj_validator = FileValidator(mime_validator, size_validator, type_validator, file_convertor)\n\nobj_validator.validate_file(\"/tmp/hello.txt\")\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Dao Quang Duy](https://github.com/duydq12)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n",
"bugtrack_url": null,
"license": "The MIT License",
"summary": "Validation for local and upload file",
"version": "0.0.0",
"project_urls": {
"Bug Tracker": "https://github.com/rabiloo/python-file-verifier/issues",
"Homepage": "https://github.com/rabiloo/python-file-verifier",
"Repository": "https://github.com/rabiloo/python-file-verifier"
},
"split_keywords": [
"file-verifier",
"file-validator",
"filetype",
"magic",
"mimetypes",
"puremagic",
"pillow"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3065733c15e1a9b34196fc5dccf0f05d61fa6df262ba0ce0bb3c77a46b34850c",
"md5": "61a3ff99a3ab9adb3ca17dea3068c120",
"sha256": "1ecf1195ef203cb77b7789e242301d55b2d96fd2fd1ecfbe5fd8013d756f9bff"
},
"downloads": -1,
"filename": "file_verifier-0.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "61a3ff99a3ab9adb3ca17dea3068c120",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 6936,
"upload_time": "2024-03-09T03:43:14",
"upload_time_iso_8601": "2024-03-09T03:43:14.956430Z",
"url": "https://files.pythonhosted.org/packages/30/65/733c15e1a9b34196fc5dccf0f05d61fa6df262ba0ce0bb3c77a46b34850c/file_verifier-0.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c6b18d3e5845462a08c8b3520ae5d9eca7127e5b199580d8c8767c51524432b5",
"md5": "c8355e19b68619bb314b18cf8bd3e984",
"sha256": "6d005ffa2843e6660486f7df5808821316df591e7fc1e771309c8306a1a0d336"
},
"downloads": -1,
"filename": "file-verifier-0.0.0.tar.gz",
"has_sig": false,
"md5_digest": "c8355e19b68619bb314b18cf8bd3e984",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 6456,
"upload_time": "2024-03-09T03:43:16",
"upload_time_iso_8601": "2024-03-09T03:43:16.973221Z",
"url": "https://files.pythonhosted.org/packages/c6/b1/8d3e5845462a08c8b3520ae5d9eca7127e5b199580d8c8767c51524432b5/file-verifier-0.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-09 03:43:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rabiloo",
"github_project": "python-file-verifier",
"github_not_found": true,
"lcname": "file-verifier"
}