NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #845 most downloaded on PyPI
A tool to determine the content type of a file with deep learning
Latest stable
1.0.3
Last release 2 days ago
19 Nov 2026
Release timing varies
gaps range from 2 weeks to 9 months
Nearly every release is documented
notes for 8 of 8 stable releases
1 version withdrawn
withdrawn after publishing
3 years old
18 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
Magika 2.0.0rc0 is the first release candidate for Magika 2.0. It introduces a major architectural upgrade: the pure-Python + ONNX Runtime engine is r
Magika 2.0.0rc0 is the first release candidate for Magika 2.0. It introduces a major architectural upgrade: the pure-Python + ONNX Runtime engine is replaced by native Rust bindings (magika via PyO3) powered by an embedded tract runtime, adding native format resolvers, custom YARA rules, GPU acceleration, parallel batch identification, and nearly double the supported content types — all while preserving public Python API compatibility and dropping all Python runtime dependencies.
[!NOTE] This release candidate still ships the
standard_v3_3ML model (alongside 310 new native format resolvers, bringing total supported outputs to 401). A smaller, faster next-generation ML model with improved short-snippet detection and further expansion toward 1000+ content types is planned for subsequent 2.0 release candidates. Help testing2.0.0rc0and reporting feedback or misdetections via GitHub Issues is very welcome!
magika crate via PyO3) running an embedded, natively compiled pure-Rust tract inference runtime. Removes all Python runtime dependencies (onnxruntime, click, numpy) while delivering significantly faster startup and inference and maintaining public API compatibility.rules and rules_files arguments to Magika(...) to evaluate custom YARA rules ahead of built-in resolvers.standard_v3_3 ML model, plus filesystem heuristics (see the full list of supported content types) — adding formats such as AVIF, QOI, GGUF, DuckDB, and Microsoft Access.Magika() returns immediately and identifies files on the CPU while the GPU is prepared in the background. identify_paths() now reads, extracts features, and runs inference in parallel batches inside the native Rust pipeline.Magika.get_content_type_info(label), detection-stage coverage fields on ContentTypeInfo (in_heuristics, in_resolvers, in_ml_model, vetoed_by_resolvers), OverwriteReason.RESOLVERS_VETO / OverwriteReason.RULES_VETO, and ContentTypeLabel.UNSUPPORTED.magika 2.0.0-rc.0): Ships the updated native Rust CLI with --custom-rules / --check-custom-rules, --no-resolvers / --no-model, symlink-cycle detection during recursive traversal, and improved reporting for non-regular files.abi3-py38 binary wheels:
glibc): x86_64 (manylinux_2_28), aarch64 (manylinux_2_28), armv7l (manylinux2014), riscv64 (manylinux_2_31).musl): x86_64 (musllinux_1_2), aarch64 (musllinux_1_2).aarch64 (Apple Silicon) and x86_64 (Intel).x86_64 and aarch64 (ARM64).magika-python-client fallback has been removed; installing magika now requires one of the pre-built native wheels (or building from source with Rust).model_dir not supported: Passing a custom model_dir to Magika(model_dir=...) currently raises NotImplementedError, as the model is natively embedded in the Rust backend.ContentTypeLabel. Use get_output_content_types() to retrieve supported labels dynamically.Your coding agent can read these notes before it upgrades. Set up the MCP server →
- Update magika CLI binary.
Remove direct dependency on numpy.
Mark end of experimental phase. No changes from last version.
Pin onnxruntime on Windows (#1099).
Nothing published for this version
Nothing published for this version
New model standard_v3_3 model, with better support for TypeScript and non-ascii characters in textual files. See models' CHANGELOG for more informatio
standard_v3_3 model, with better support for TypeScript and non-ascii characters in textual files. See models' CHANGELOG for more information.identify_stream() now restores the stream's original position after reading from it, preventing side effects on subsequent stream operations. (#1020)asdict() utility method to MagikaResult.prediction.overwrite_reason to Overwrite.NONE if output.label is the same as dl.label. (#1023)…improvements, API enhancements, and a few breaking changes. This changelog entry rolls up all changes from v0.5.1, the last stable release.
Magika v0.6.1 is a significant update featuring a new model with 2x supported content types, a new command line client in Rust, performance improvements, API enhancements, and a few breaking changes. This changelog entry rolls up all changes from v0.5.1, the last stable release.
[!IMPORTANT] There are a few breaking changes! After reading about the new key features and improvements, we suggest to consult the migration guide below and the updated documentation.
standard_v3_2, which supports 2x content types (200+ in total, see full list here), has a similar ~99% average accuracy, and is ~20% faster, with an inference speed of about ~2ms on CPUs (YMMV depending on your testing setup). See models' CHANGELOG for more information.magika python package. This new client replaces the old client written in Python (but the old Python one is still available as a fallback for those platforms for which we don't have precompiled rust binaries).identify_stream(stream: typing.BinaryIO) API to infer content types from open binary streams. (#970)identify_path and identify_paths now accept Union[str, os.PathLike] objects. You no longer need to explicitly use pathlib.Path. (#935)MagikaResult, which is a absl::StatusOr-like object that wraps MagikaPrediction, with a clear separation between valid predictions and error situations; the output content types (label) are not just str anymore, but of type ContentTypeLabel, making integrations more robust (ContentTypeLabel extends StrEnum: thus, they are not just str, but you can treat them as such). The MagikaPrediction object now has additional is_text and extensions fields (in addition to the existing label, mime_type, group, and description).get_output_content_types(), get_model_content_types(), get_module_version(), and get_model_name().This release introduces several breaking changes. Please review this guide carefully to update your code:
identify_* API output format: The inference Python APIs now return a MagikaResult object, which is similar to absl::StatusOr; This provides a cleaner way to handle errors. dl.ct_label and output.ct_label are renamed to dl.label and output.label. labels are now of type ContentTypeLabel, which extends StrEnum (thus, they are not just str, but you can treat them as such). The score field is now at the top level, alongside dl and output. The magic field has been removed as it was often either incorrect or redundant; use description instead.Before (v0.5.x and earlier):
import magika
m = magika.Magika()
result = m.identify_path("my_file.py")
print(result.output.ct_label) # Assumed success
After (v0.6.1):
import magika
m = magika.Magika()
result = m.identify_path("my_file.py")
if result.ok():
print(result.output.label)
else:
print(f"Error: {result.status}")
score field is now at the top level, alongside dl and output, and is no longer nested within dl or output. The output also includes is_text and extensions fields. The magic metadata has been removed as it was often either incorrect or redundant; use description instead. Moreover, similarly to what happens under the hood with the StatusOr pattern, result.status indicates whether the prediction was successful, and the prediction results are available under the result.value key.Before (v0.5.x and earlier): (Illustrative example - adapt to your specific output)
{
"path": "code.py",
"dl": {
"ct_label": "python",
"score": 0.9940916895866394,
"group": "code",
"mime_type": "text/x-python",
"magic": "Python script",
"description": "Python source"
},
"output": {
"ct_label": "python",
"score": 0.9940916895866394,
"group": "code",
"mime_type": "text/x-python",
"magic": "Python script",
"description": "Python source"
}
}
After (v0.6.1):
{
"path": "code.py",
"result": {
"status": "ok",
"value": {
"dl": {
"description": "Python source",
"extensions": ["py", "pyi"],
"group": "code",
"is_text": true,
"label": "python",
"mime_type": "text/x-python"
},
"output": {
"description": "Python source",
"extensions": ["py", "pyi"],
"group": "code",
"is_text": true,
"label": "python",
"mime_type": "text/x-python"
},
"score": 0.9890000224113464
}
}
}
dl.label == ContentTypeLabel.UNDEFINED when the model is not used: There are situations in which the deep learning model is not used, for example when the file is too small or empty. In these cases, dl.label is now set to ContentTypeLabel.UNDEFINED instead of having the full dl block being set to None.Before (v0.5.x and earlier):
# ... (assuming successful result)
if prediction.dl is not None:
print(prediction.dl.ct_label)
After (v0.6.1):
# ... (assuming successful result)
if prediction.dl.label != magika.ContentTypeLabel.UNDEFINED:
print(prediction.dl.label)
javascript may not be detected as typescript. Consider using get_output_content_types() to dynamically retrieve the supported labels.$ magika-python-client.For a detailed list of all changes, including those from the -rc releases, please refer to the individual changelog entries for each release candidate:
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add support for python 3.12. Magika now supports python >=3.8 and <3.13.
--list-output-content-types; see FAQs for context).New public python APIs: identify_paths, identify_path, identify_bytes.
identify_paths, identify_path, identify_bytes.MagikaResult object.-p/--output-probability has been renamed to -s/--output-score for consistency.standard_v1.- First release.
One column per quarter.