typecode-libmagic
A ScanCode path provider plugin to provide a prebuilt native libmagic binary and database.
What it is and what it does
typecode-libmagic is a plugin for the ScanCode toolkit that bundles a prebuilt native libmagic binary and its associated file-type database. It enables file type detection and analysis by providing the underlying libmagic library as a managed dependency, rather than requiring users to install libmagic separately on their system. The package distributes platform-specific wheels for macOS, Linux, and Windows, handling the complexity of cross-platform binary distribution.
The plugin is part of the ScanCode ecosystem and integrates transparently into ScanCode's path provider system. It is licensed under a composite of Apache 2.0 and multiple open-source licenses covering the bundled binaries. The repository is actively maintained, though the most recent release dates to 2021; it serves primarily as a stable, prebuilt dependency for ScanCode users who need reliable file type identification without managing native library installations.
Use it for:
- Integrate file type detection into ScanCode-based software composition analysis workflows.
- Avoid system-level libmagic installation by using a prebuilt, versioned binary via pip.
- Ensure consistent file type identification across macOS, Linux, and Windows CI/CD environments.
- Bundle libmagic with ScanCode in containerized or isolated Python environments.
- Extend ScanCode toolkit with native binary capabilities without manual compilation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a prebuilt native libmagic binary and database as a ScanCode plugin for file type detection and analysis.
Yes, if you are using ScanCode toolkit and need reliable file type detection without managing system libmagic installations. The prebuilt binaries simplify cross-platform deployment. However, review the composite license terms carefully if you have proprietary or restricted licensing requirements. The 2021 release date warrants verification that it remains compatible with your ScanCode version.
Install
typecode-libmagic on PyPI
pip
pip install typecode-libmagicuv
uv add typecode-libmagicpoetry
poetry add typecode-libmagicInstalling typecode-libmagic
Before you install
Medium install friction due to platform-specific prebuilt binaries (macOS, Linux, Windows wheels provided). Repository is actively maintained with recent commits, though the latest release is from 2021.
License in practice
Complex multi-license composition (Apache 2.0 plus multiple BSD, ISC, GPL, and public-domain components) classified as copyleft. Users must comply with the most restrictive terms of bundled binaries; review the full license stack before using in proprietary or restricted contexts.
Quickstart
pip install typecode-libmagic
import typecode_libmagic
# Plugin integrates with ScanCode toolkit for file type detection
Requires ScanCode toolkit to be installed; plugin is designed as an extension to ScanCode, not standalone.
Verify before relying
- Whether the 2021 release date reflects actual maintenance or if the package is in maintenance-only mode.
- Compatibility with current ScanCode toolkit versions and Python 3.9+.
- Performance characteristics and accuracy of the bundled libmagic version.
Package facts
| License | apache-2.0 AND bsd-simplified-darwin AND (bsd-simplified AND public-domain AND bsd-new AND isc AND (bsd-new OR gpl-1.0-plus) AND bsd-original) (copyleft) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,901 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 125,820/month — #11,798 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: typecode_libmagic-5.39.210531-py3-none-macosx_10_14_x86_64.whl; typecode_libmagic-5.39.210531-py3-none-manylinux1_x86_64.whl; typecode_libmagic-5.39.210531-py3-none-win_amd64.whl
Keywords: open source, typecode, libmagic
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
extractcode-libarchiveProvides a prebuilt native libarchive binary as…
permissive · top 15,000 on PyPI
scancode-toolkitScanCode Toolkit detects licenses, copyrights,…
permissive · top 15,000 on PyPI
typecodeDetects file types and MIME types using…
permissive · top 15,000 on PyPI
extractcode-7zProvides a prebuilt native 7z binary as a…
copyleft · top 15,000 on PyPI
plugincodePlugincode provides a plugin system for Python…
permissive · top 15,000 on PyPI
python-magic-binIdentifies file types by examining file headers…
permissive · top 15,000 on PyPI
libmagicProvides Python bindings to the libmagic…
copyleft · top 15,000 on PyPI
python-magicIdentifies file types by reading file headers…
permissive · top 1,000 on PyPI
pylibmagicProvides pre-compiled libmagic libraries…
permissive · top 15,000 on PyPI
file-magicfile-magic provides a Python interface to…
permissive · top 15,000 on PyPI