Xendpal-magic: Advanced File Type Detection Library
Project description
Xendpal-magic: Advanced File Type Detection Library
Xendpal-magic 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, Xendpal-magic 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 = matcher.determine_file_type('path to file')
print(file_type) # Outputs: 'application/pdf'
Advanced Usage
Custom Detection Strategy
matcher = FileSignatureMatcher(detection_method='signature', return_type='description')
file_description = matcher.determine_file_type('path to file')
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'
)
Contributing
Contributions are welcome! Please read our Contributing Guide for details on how to submit pull requests, report issues, and suggest improvements.
License
Xendpal-magic is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Special thanks to all contributors who have helped shape Xendpalmagic into what it is today.
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.2.tar.gz
(8.9 kB
view hashes)
Built Distribution
Close
Hashes for xendpalmagic-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8748cca1068f24cd6b3fe0addfdcd97fa01d7f5ade36e9508e535050c5435860 |
|
MD5 | 5e49805f04791cd0a4f2bd6f58de2ebd |
|
BLAKE2b-256 | 7920608c56f3ee46cd879a7b4c83256d418aed75784ccc29d04777a3b203f3e6 |