Registry / data / typecode-libmagic

typecode-libmagic

JSON →
library5.39.210531pypypiunverified

A Scancode path provider plugin that downloads and provides a prebuilt native libmagic binary and its database for file type detection. Version 5.39.210531. Low release cadence; primarily used as a dependency within the ScanCode toolkit ecosystem.

pip install typecode-libmagic
INSTALL
IMPORT
SIG · TYPECODE-LIBMAGIC
T
typecode-libmagic
datapythonv5.39.210531
Install
1.8s avg
Import
—
Disk
23MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v5.39.210531 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
build_error
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.8s · import 0.000s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LibmagicPathProvider
✓ from typecode_libmagic import LibmagicPathProvider
✗ from typecode_libmagic import LibmagicPathProvider

Instantiate the provider to get the path to the bundled libmagic binary.

from typecode_libmagic import LibmagicPathProvider provider = LibmagicPathProvider() print(provider.get_libmagic_path())
Debug
Known issues
gotchaDo not install typecode-libmagic directly unless you are building a ScanCode plugin environment. For general use, rely on typecode which pulls this plugin automatically.
fix
Install typecode instead: pip install typecode
affects: all
breakingIn versions prior to 1.0.0, the provider class was located in a different module. Update imports if upgrading from an older release.
fix
Use from typecode_libmagic import LibmagicPathProvider
affects: <1.0.0
deprecatedThe old method get_libmagic() is deprecated in favor of get_libmagic_path() which returns a path string.
fix
Replace provider.get_libmagic() with provider.get_libmagic_path()
affects: >=1.0.0
Upgrade
Version history
5.39.210531latest on PyPI · released May 31, 2021
Audit
Dependencies
typecoderequiredLibrary that consumes the libmagic binary provided by this plugin
plugincoderequiredPlugin infrastructure used by ScanCode
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
typecode-libmagic — pip install typecode-libmagic · libregistry