skillfed

typecode-libmagic

A ScanCode path provider plugin to provide a prebuilt native libmagic binary and database.

typecode-libmagic v5.39.210531 125.8K downloads/30d#11,798 on PyPI2
Copyleft 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) Active released

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-libmagic

uv

uv add typecode-libmagic

poetry

poetry add typecode-libmagic

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonTopic :: Utilities

Tags

libmagic file type detectionscancode plugin binaryfile magic number identificationprebuilt native library pluginfile format recognitionscancode toolkit extensionmagic database provider
scancode-pluginfile-type-detectionprebuilt-binary

More Utilities packages