{"id":24748,"library":"typecode-libmagic","title":"typecode-libmagic","description":"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.","status":"active","version":"5.39.210531","language":"python","source_language":"en","source_url":"https://github.com/nexB/scancode-plugins","tags":["libmagic","file-type","scanning","plugin"],"install":[{"cmd":"pip install typecode-libmagic","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Library that consumes the libmagic binary provided by this plugin","package":"typecode","optional":false},{"reason":"Plugin infrastructure used by ScanCode","package":"plugincode","optional":false}],"imports":[{"wrong":"from typecode_libmagic import LibmagicPathProvider","symbol":"LibmagicPathProvider","correct":"from typecode_libmagic import LibmagicPathProvider"}],"quickstart":{"code":"from typecode_libmagic import LibmagicPathProvider\nprovider = LibmagicPathProvider()\nprint(provider.get_libmagic_path())","lang":"python","description":"Instantiate the provider to get the path to the bundled libmagic binary."},"warnings":[{"fix":"Install typecode instead: pip install typecode","message":"Do not install typecode-libmagic directly unless you are building a ScanCode plugin environment. For general use, rely on typecode which pulls this plugin automatically.","severity":"gotcha","affected_versions":"all"},{"fix":"Use from typecode_libmagic import LibmagicPathProvider","message":"In versions prior to 1.0.0, the provider class was located in a different module. Update imports if upgrading from an older release.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Replace provider.get_libmagic() with provider.get_libmagic_path()","message":"The old method get_libmagic() is deprecated in favor of get_libmagic_path() which returns a path string.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'5.39.210531':26 'binari':17 'cadenc':29 'databas':20 'depend':34 'detect':24 'download':10 'ecosystem':39 'file':22,42 'file-typ':41 'libmag':3,16,40 'low':27 'nativ':15 'path':6 'plugin':8,45 'prebuilt':14 'primarili':30 'provid':7,12 'releas':28 'scan':44 'scancod':5,37 'toolkit':38 'type':23,43 'typecod':2 'typecode-libmag':1 'use':31 'version':25 'within':35","created_at":"2026-05-01T08:14:43.323902+00:00","updated_at":"2026-05-01T08:14:43.323902+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpm0s7l4ap/venv/lib/python3.12/site-packages/typecode_libmagic/__init__.py\", line 29, in <module>\n    from plugincode.location_provider import LocationProviderPlugin\nModuleNotFoundError: No module named 'pluginco"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"5.39.210531","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/nexB/scancode-plugins","docs":null,"changelog":null,"pypi":"https://pypi.org/project/typecode-libmagic/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}