mineru-magika
A Python-only fork of Google Magika, based on the published 1.0.3 source. The distribution is named mineru-magika; the Python import remains magika. This fork is maintained independently and is not an official Google release.
Installation
Choose one ONNX Runtime distribution yourself. This package only installs
click>=8.1.7; it does not install ONNX Runtime, DirectML, or GPU extras.
# CPU runtime (choose a version compatible with your Python/platform)
pip install mineru-magika onnxruntime
# Windows x64, Python 3.10–3.14
pip install mineru-magika "onnxruntime-directml>=1.23,<2"
Python >=3.8 is supported when a compatible ONNX Runtime is installed. Without a
runtime, installation succeeds but importing magika fails with a missing
onnxruntime module. There is no runtime download or automatic backend selection.
Do not install magika and mineru-magika together: they own the same Python
namespace. In an existing environment, uninstall magika before installing this
fork. A downstream requirement for the distribution magika must also be changed;
installing this fork does not satisfy that requirement automatically.
Python API and CLI
from magika import Magika
result = Magika().identify_bytes(b"function log(msg) {console.log(msg);}")
print(result.output.label) # javascript
magika-python-client --version
magika-python-client path/to/file
As in the upstream pure-Python wheel, magika prints a warning directing you to
magika-python-client and exits with status 1. No Rust executable is bundled.
The Python API, model, configuration and classification behavior are unchanged.
The upstream CPUExecutionProvider selection is retained, including when using
the DirectML distribution; this fork does not enable GPU inference.
Fork changes and provenance
Version 1.0.3 uses upstream commit 9f225aa480e675af44343b9160f077073ed1b752.
Changes are limited to distribution metadata, caller-managed runtime dependencies,
distribution version lookups, Python-only packaging, documentation and CI.
Model and configuration SHA-256 values are recorded in
python/scripts/resource_hashes.json in the source repository and checked against
installed artifacts. Original source copyright notices and the Apache-2.0 license
are retained. The upstream multi-language sources remain for provenance but are
not included in the Python distributions.
Development and release
From the repository's python directory:
uv sync --locked
uv pip install onnxruntime
uv run --no-sync pytest tests
uv build
CI builds a universal wheel and sdist, rebuilds the wheel from the sdist, and tests normal installation without any runtime. CPU checks cover Windows, Linux and macOS on Python 3.10–3.14, plus Linux 3.8/3.9. Windows x64 also checks environments containing only the DirectML distribution. Linux Python 3.12 runs the upstream Python regression suite. Runtime dependencies are installed explicitly by CI.
Tags matching v<version> publish the exact tested artifacts through GitHub
Trusted Publishing. Configure the PyPI pending publisher with project
mineru-magika, owner myhloli, repository mineru-magika, workflow publish.yml
and environment pypi. Publishing requires all validation jobs to pass.
Metadata
Release files for mineru-magika 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mineru_magika-1.0.3.tar.gz | 3.0 MB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mineru_magika-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.9 MB
Release files / mineru_magika-1.0.3.tar.gz
| Download URL | mineru_magika-1.0.3.tar.gz |
|---|---|
| Size | 3.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
228351299e8a8c3f8523e58a8d4c3726f176be906420a5598bf791929f66860e
|
|
BLAKE2b-256 checksum How to use checksums |
a0330042252dc565c6a34fbb8d88fb9d74fe8256ff86ad62dfb4a01fb41ac1cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logRelease files / mineru_magika-1.0.3-py3-none-any.whl
| Download URL | mineru_magika-1.0.3-py3-none-any.whl |
|---|---|
| Size | 3.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b67e05769f48c28d4d5dda0869ece4f4acce769ec7ab6ed169ed34ee5b58343
|
|
BLAKE2b-256 checksum How to use checksums |
5eb68edeeeb341087fd3ae3483ba70deb87121f59261ce738786eee5bf312b89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logSecurity for mineru-magika 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mineru_magika-1.0.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.