---
# 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:
```bash
pip install xendpalmagic
```
## Quick Start
```python
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
```python
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
```python
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'
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/joeygoesgrey/xendpal-magic",
"name": "xendpalmagic",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "file type detection, file signatures, MIME type, content analysis, python, file handling, file identification, magic numbers, file metadata",
"author": "joeygoesgrey",
"author_email": "mail@godfreydjoseph@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/30/67/23a7a2a90125eb5d83b987eff3498a42ea8528d4b540440c468d9fd44d7d/xendpalmagic-0.0.5.tar.gz",
"platform": null,
"description": "\n\n---\n\n# Xendpalmagic: Advanced File Type Detection Library\n\nXendpalmagic 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.\n\n## Features\n\n- **Robust File Type Detection**: Utilizes magic numbers, content analysis, and header parsing for accurate file identification.\n- **Customizable Detection Strategies**: Tailor the detection process to prioritize speed, accuracy, or a balance of both.\n- **Extensive File Format Support**: Comes with a broad database of file signatures and MIME types, with the flexibility to add new ones.\n- **Developer-friendly**: Easy to integrate and use in any Python project requiring file handling capabilities.\n\n## Installation\n\nInstall Xendpal-magic using pip:\n\n```bash\npip install xendpalmagic\n```\n\n## Quick Start\n\n```python\nfrom xendpalmagic import FileSignatureMatcher\n\n# Initialize the matcher\nmatcher = FileSignatureMatcher()\n\n# Determine the file type of 'example.pdf'\nfile_type, method = matcher.determine_file_type('example.pdf')\nprint(file_type) # Outputs: 'application/pdf'\n\n```\n\n## Advanced Usage\n\n### Custom Detection Strategy\n\n```python\nmatcher = FileSignatureMatcher(detection_method='signature', return_type='description')\nfile_description, method = matcher.determine_file_type('example.docx')\nprint(file_description) # Outputs: 'Microsoft Word document'\n\n```\n\n### Adding Custom File Signatures\n\n```python\nmatcher.add_custom_signature(\n extension='custom',\n hex_signatures=['00 11 22 33', '44 55 66 77'],\n description='Custom File Format',\n mime_type='application/x-custom'\n)\n```\n\n \n \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Xendpalmagic: Advanced File Type Detection Library",
"version": "0.0.5",
"project_urls": {
"Documentation": "https://github.com/joeygoesgrey/xendpal-magic#readme",
"Homepage": "https://github.com/joeygoesgrey/xendpal-magic",
"Source": "https://github.com/joeygoesgrey/xendpal-magic",
"Tracker": "https://github.com/joeygoesgrey/xendpal-magic/issues"
},
"split_keywords": [
"file type detection",
" file signatures",
" mime type",
" content analysis",
" python",
" file handling",
" file identification",
" magic numbers",
" file metadata"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "4881548bff37e66cd1e1776c0f08a2af9074de9f1b402c9baf941bcd4c4f375d",
"md5": "d08a3fdd2e8ac573377653c039226c9c",
"sha256": "2d1459a2e7bf16641cf05d2f09d509bb2d0247251aae36925de791c71bcb70db"
},
"downloads": -1,
"filename": "xendpalmagic-0.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d08a3fdd2e8ac573377653c039226c9c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 8386,
"upload_time": "2025-07-10T20:46:30",
"upload_time_iso_8601": "2025-07-10T20:46:30.277572Z",
"url": "https://files.pythonhosted.org/packages/48/81/548bff37e66cd1e1776c0f08a2af9074de9f1b402c9baf941bcd4c4f375d/xendpalmagic-0.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "306723a7a2a90125eb5d83b987eff3498a42ea8528d4b540440c468d9fd44d7d",
"md5": "da3591887388d283b3586f117447882e",
"sha256": "6e86dbe95ce6a1342f822bd83f6ab8a46cd7f0cd93cc4e3be87ea96305085b1f"
},
"downloads": -1,
"filename": "xendpalmagic-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "da3591887388d283b3586f117447882e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 9466,
"upload_time": "2025-07-10T20:46:31",
"upload_time_iso_8601": "2025-07-10T20:46:31.382990Z",
"url": "https://files.pythonhosted.org/packages/30/67/23a7a2a90125eb5d83b987eff3498a42ea8528d4b540440c468d9fd44d7d/xendpalmagic-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-10 20:46:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "joeygoesgrey",
"github_project": "xendpal-magic",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "xendpalmagic"
}