awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
ahupp avatar

ahupp/python-magic

0
View on GitHub↗
2,886 星标·306 分支·Python·other·3 次浏览

Python Magic

python-magic is a C-binding wrapper that provides a Python interface for the libmagic system library. It functions as a file signature analyzer and MIME type detector, identifying file formats by comparing header bytes against a database of known binary signatures.

The library enables the identification of file types from both file paths and raw data buffers. It supports custom file signature matching through the injection of user-provided magic databases, allowing for the detection of specialized or proprietary formats.

The project covers binary data analysis and MIME type mapping to translate internal identification codes into standardized media type strings.

Features

  • Magic Byte File Identification - Identifies file types by matching header magic bytes against a database of known binary signatures.
  • Binary Data Analysis - Examines byte streams and buffers to determine the original file format or encoding.
  • libmagic Wrappers - Acts as a Python wrapper for the libmagic C library to identify file types via header bytes.
  • MIME Type Detection - Determines the human-readable description or MIME type of data streams and byte buffers.
  • MIME Type Detectors - Determines the MIME type of files and data buffers based on the magic database.
  • File Type Inference - Determines the format of a file by comparing its header bytes against a database of signatures.
  • MIME Type Mappings - Translates internal identification codes into standardized internet media type strings for interoperability.
  • Custom Magic Databases - Supports the use of custom signature databases to detect specialized or proprietary file formats.
  • File Signature Analyzers - Compares file byte sequences against a database to produce human-readable descriptions of file formats.
  • Custom Signature Matching - Uses specialized magic databases to identify proprietary or niche file formats.
  • In-Memory Byte Stream Processing - Provides the ability to analyze binary data sequences directly in memory to identify file types without disk persistence.
  • C-Library Bindings - Provides a Python interface for programmatic access to the underlying libmagic C library.
  • Data Loading Extraction - Wrapper for libmagic.
  • File System Utilities - Interface for libmagic to detect file types.

Star 历史

ahupp/python-magic 的 Star 历史图表ahupp/python-magic 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Python Magic 的开源替代方案

相似的开源项目,按与 Python Magic 的功能重合度排序。
  • sindresorhus/file-typesindresorhus 的头像

    sindresorhus/file-type

    4,297在 GitHub 上查看↗

    file-type is a binary file type detector that identifies file extensions and MIME types by analyzing magic numbers and signature bytes in binary data. It functions as a magic number parser and MIME type resolver, mapping binary signatures to standardized media type strings. The project is an extensible file format identifier that allows for the addition of custom detector plugins to recognize uncommon or non-binary file formats. The engine supports binary format identification across various data sources, including buffers and data streams. It utilizes a supported format registry and provide

    JavaScript
    在 GitHub 上查看↗4,297
  • apache/tikaapache 的头像

    apache/tika

    3,572在 GitHub 上查看↗

    Tika is a content analysis toolkit and Java library designed for detecting and extracting metadata and text from thousands of different file types. It functions as a universal document text extractor and metadata extraction engine, converting complex files into plain text or XHTML. The system employs a specialized MIME type detector that identifies document formats using magic bytes and metadata to determine the correct parser. It serves as an OCR integration gateway, connecting to external text recognition tools to extract content from image files. The project covers a broad range of extrac

    Javacontentextractionjava
    在 GitHub 上查看↗3,572
  • bioruebe/uniextract2Bioruebe 的头像

    Bioruebe/UniExtract2

    4,344在 GitHub 上查看↗

    UniExtract2 is a suite of tools designed for universal archive extraction, batch decompression, and file format analysis. It retrieves files from various compressed formats, software installers, disk images, and game archives into local directories. The project includes a file format analyzer that identifies file types by scanning internal contents and headers without requiring full extraction. It also features an archive password decrypter that attempts to recover access to protected archives using a predefined list of common passwords. The tool supports bulk decompression workflows through

    AutoItdecompressionextractorfile-analysis
    在 GitHub 上查看↗4,344
  • kreuzberg-dev/kreuzbergkreuzberg-dev 的头像

    kreuzberg-dev/kreuzberg

    8,527在 GitHub 上查看↗

    Kreuzberg is a document extraction engine that converts PDFs, Office files, images, and over 90 other formats into clean, structured text and metadata. It is built around a compiled Rust core that can be used as a native library, a command-line tool, a REST API server, or a WebAssembly module for browser-based processing. The system is designed to run entirely on self-hosted infrastructure, with no data leaving the user's environment. What distinguishes Kreuzberg is its breadth of integration surfaces and its pipeline architecture. It exposes extraction capabilities through native bindings fo

    Rustdocument-intelligenceelixirffi
    在 GitHub 上查看↗8,527
查看 Python Magic 的所有 30 个替代方案→

常见问题解答

ahupp/python-magic 是做什么的?

python-magic is a C-binding wrapper that provides a Python interface for the libmagic system library. It functions as a file signature analyzer and MIME type detector, identifying file formats by comparing header bytes against a database of known binary signatures.

ahupp/python-magic 的主要功能有哪些?

ahupp/python-magic 的主要功能包括:Magic Byte File Identification, Binary Data Analysis, libmagic Wrappers, MIME Type Detection, MIME Type Detectors, File Type Inference, MIME Type Mappings, Custom Magic Databases。

ahupp/python-magic 有哪些开源替代品?

ahupp/python-magic 的开源替代品包括: sindresorhus/file-type — file-type is a binary file type detector that identifies file extensions and MIME types by analyzing magic numbers and… apache/tika — Tika is a content analysis toolkit and Java library designed for detecting and extracting metadata and text from… bioruebe/uniextract2 — UniExtract2 is a suite of tools designed for universal archive extraction, batch decompression, and file format… kreuzberg-dev/kreuzberg — Kreuzberg is a document extraction engine that converts PDFs, Office files, images, and over 90 other formats into… ldqk/masuit.tools — Masuit.Tools is a comprehensive static utility library for .NET and ASP.NET Core development. It provides a broad… danog/madelineproto — MadelineProto is an asynchronous PHP library that provides a programmatic interface for interacting with the Telegram…