Skip to main content

Libs check filetype

Project description

Thư viện kiểm tra file type.

Cài đặt:

 $ pip3 install m-filetype

Sử dụng

from truestrive.libs.filetypes.file import File
from truestrive.libs.filetypes.common import ExtensionImage

File.check_filetype_by_file_extensions(
    file_binary=file, # Check filetype của định dạng file binary.Mặc định None
    file_path=file_path, # Check filetype của path file
    extensions=[ExtensionImage.PNG] # Danh sách extension cần check.
)

Lấy extensions support

  • Extension Image:
from truestrive.libs.filetypes.common import ExtensionImage
ExtensionImage.LIST_EXTENSION_SUPPORTED
  • Extension Document:
from truestrive.libs.filetypes.common import ExtensionDocument
ExtensionDocument.LIST_EXTENSION_SUPPORTED
  • Extension Audio:
from truestrive.libs.filetypes.common import ExtensionAudio
ExtensionAudio.LIST_EXTENSION_SUPPORTED

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

validate-extension-file-0.0.2.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

validate_extension_file-0.0.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file validate-extension-file-0.0.2.tar.gz.

File metadata

  • Download URL: validate-extension-file-0.0.2.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.9

File hashes

Hashes for validate-extension-file-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2f96eaa6adefaa96ca298270cc99089b2e91ad2d38284bb60d1bc8cf3dc1bee1
MD5 1db87090f638c7e322d7c9346442eaee
BLAKE2b-256 a562bebf15737a6db3b6b799031a472eebc4e9f1ff2bcaf1abf20457c4d6b3e4

See more details on using hashes here.

File details

Details for the file validate_extension_file-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for validate_extension_file-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cdaa3fd9b275ba34d525133eff775fee367739c2fbac23201e66bc7542a32fb0
MD5 582eabf7f58952d9c3bcd1aeec49d898
BLAKE2b-256 402261440de7944e9cb20ee2edac8c15e668b35bfa9745703d9a768107322081

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page