Skip to main content

Xendpalmagic: Advanced File Type Detection Library

Project description


Xendpalmagic: Advanced File Type Detection Library

Xendpalmagic is a comprehensive Python library designed to enhance file type detection through a multi-faceted approach. By combining file extensions, magic numbers, content analysis, and header parsing, Xendpalmagic offers unmatched accuracy and reliability for identifying a wide range of file formats.

Features

  • Robust File Type Detection: Utilizes magic numbers, content analysis, and header parsing for accurate file identification.
  • Customizable Detection Strategies: Tailor the detection process to prioritize speed, accuracy, or a balance of both.
  • Extensive File Format Support: Comes with a broad database of file signatures and MIME types, with the flexibility to add new ones.
  • Developer-friendly: Easy to integrate and use in any Python project requiring file handling capabilities.

Installation

Install Xendpal-magic using pip:

pip install xendpalmagic

Quick Start

from xendpalmagic import FileSignatureMatcher

# Initialize the matcher
matcher = FileSignatureMatcher()

# Determine the file type of 'example.pdf'
file_type, method = matcher.determine_file_type('example.pdf')
print(file_type)  # Outputs: 'application/pdf'

Advanced Usage

Custom Detection Strategy

matcher = FileSignatureMatcher(detection_method='signature', return_type='description')
file_description, method = matcher.determine_file_type('example.docx')
print(file_description)  # Outputs: 'Microsoft Word document'

Adding Custom File Signatures

matcher.add_custom_signature(
    extension='custom',
    hex_signatures=['00 11 22 33', '44 55 66 77'],
    description='Custom File Format',
    mime_type='application/x-custom'
)

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

xendpalmagic-0.0.5.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

xendpalmagic-0.0.5-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file xendpalmagic-0.0.5.tar.gz.

File metadata

  • Download URL: xendpalmagic-0.0.5.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for xendpalmagic-0.0.5.tar.gz
Algorithm Hash digest
SHA256 6e86dbe95ce6a1342f822bd83f6ab8a46cd7f0cd93cc4e3be87ea96305085b1f
MD5 da3591887388d283b3586f117447882e
BLAKE2b-256 306723a7a2a90125eb5d83b987eff3498a42ea8528d4b540440c468d9fd44d7d

See more details on using hashes here.

File details

Details for the file xendpalmagic-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: xendpalmagic-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for xendpalmagic-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2d1459a2e7bf16641cf05d2f09d509bb2d0247251aae36925de791c71bcb70db
MD5 d08a3fdd2e8ac573377653c039226c9c
BLAKE2b-256 4881548bff37e66cd1e1776c0f08a2af9074de9f1b402c9baf941bcd4c4f375d

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