$npx skillfedfor your agent

magika

A tool to determine the content type of a file with deep learning

Worth itPyPI Software DevelopmentReleased May 202615.2M downloads / moApache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — magika-1.0.3-py3-none-any.whl
v1.0.3 · released 2026-05-04 · Python >=3.8 · 2 runtime deps: click, onnxruntime

Yes. Magika is actively maintained, has low install friction, carries no security vulnerabilities, and uses a permissive license. It solves a real problem (accurate file type detection) with a well-engineered approach. Install it if you need reliable file type identification beyond simple extension or magic-byte checks; skip it only if your use case is limited to a handful of well-known formats where simpler tools suffice.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • onnxruntime must be available; the package includes platform-specific compiled wheels for common architectures, with a pure-Python fallback for unsupported platforms.
  • Low friction install with only two runtime dependencies (click and onnxruntime).
  • Active maintenance with recent commits and a large repository following (17950 stars).

License · maintenance · safety

Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. Suitable for most projects without license compatibility concerns.

last release 2026-05-04 (102 days) · last repo commit 2026-08-07 · 17,950 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 15,165,486 downloads/mo, #1,196 on PyPI

Verify before relying

pip install magika

from magika import Magika
m = Magika()
res = m.identify_bytes(b'function log(msg) {console.log(msg);}')
print(res.output.label)  # outputs: javascript
  • Whether the ~100M training samples and 200+ content types mentioned in the description are current for version 1.0.3.
  • Performance characteristics (millisecond detection times) on typical hardware configurations.
  • Exact list of all 200+ supported file formats and their detection accuracy breakdown.
Same gist for agents: .md · .json

What it is and what it does

Magika is an AI-powered file type detection tool that uses a lightweight deep learning model to identify file content types by analyzing file bytes rather than relying on file extensions or magic numbers alone. It works as both a standalone command-line tool and a Python library, making it suitable for integration into larger systems or use as a utility.

The package wraps a custom-trained neural network model (a few MBs in size) that has been trained on approximately 100M samples across 200+ content types, covering both binary and textual formats. It provides structured output including the detected label, description, MIME type, file extensions, and a confidence score. The tool supports multiple output formats (plain text, JSON, JSONL) and can process files from disk, stdin, or byte streams in Python code.

Use it for

  • Validate uploaded file types in web applications without trusting user-supplied extensions or MIME type headers.
  • Automatically categorize and organize files in bulk processing pipelines by their actual content rather than filename.
  • Detect potentially malicious files disguised with incorrect extensions during security scanning workflows.
  • Build content-aware indexing systems that need accurate file type information for search or filtering.
  • Replace or supplement traditional file magic number detection in tools that need higher accuracy on modern formats.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Magika is actively maintained, has low install friction, carries no security vulnerabilities, and uses a permissive license. It solves a real problem (accurate file type detection) with a well-engineered approach. Install it if you need reliable file type identification beyond simple extension or magic-byte checks; skip it only if your use case is limited to a handful of well-known formats where simpler tools suffice.

Install

magika on PyPI

Before you install

Low friction install with only two runtime dependencies (click and onnxruntime). Active maintenance with recent commits and a large repository following (17950 stars). Supports Python 3.8 through 3.14, distributed as a pre-built wheel.

onnxruntime must be available; the package includes platform-specific compiled wheels for common architectures, with a pure-Python fallback for unsupported platforms.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. Suitable for most projects without license compatibility concerns.

Quickstart

pip install magika

from magika import Magika
m = Magika()
res = m.identify_bytes(b'function log(msg) {console.log(msg);}')
print(res.output.label)  # outputs: javascript

Verify before relying

  • Whether the ~100M training samples and 200+ content types mentioned in the description are current for version 1.0.3.
  • Performance characteristics (millisecond detection times) on typical hardware configurations.
  • Exact list of all 200+ supported file formats and their detection accuracy breakdown.

Package facts

LicenseApache-2.0 permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
2 packages
clickonnxruntime
MaintenanceActively maintained 102 days since the last release
Last repo commit
First released
Downloads15,165,486 / month, #1,196 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: SecurityTopic :: Software DevelopmentTyping :: Typed

Evidence: magika-1.0.3-py3-none-any.whl

Tags

Capabilities
file type detectioncontent type identificationdeep learning file detectionMIME type detectionfile format recognitionmagic bytes alternativeAI-powered file analysis
Topics
file-detectiondeep-learningsecurity
PyPI keywords
content type detectionmachine learning

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “content type identification”

  • magikaMagika identifies file types using deep learning, analyzing file…
  • identifyIdentifies file types by examining file paths, names, shebangs, and…
  • python-magic-binIdentifies file types by examining file headers using libmagic,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also filetype · cigam · python-magic-bin · puremagic · python-magic · libmagic · file-magic · tika · zope.contenttype · tinytag