$npx skillfedfor your agent

typecode

Comprehensive filetype and mimetype detection using libmagic and Pygments.

Worth itPyPI Software DevelopmentReleased Mar 2026127.4K downloads / moApache-2.0Pure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — typecode-30.2.0-py3-none-any.whl
v30.2.0 · released 2026-03-23 · Python >=3.10 · 5 runtime deps: attrs, binaryornot, commoncode, pdfminer.six, plugincode

Yes. Active maintenance, production-stable status, low install friction, no known vulnerabilities, and permissive licensing make it a solid choice. Install with [full] for immediate use, or [minimal] if your environment already provides libmagic 5.39. Best suited for projects needing reliable file type detection beyond filename inspection.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires libmagic 5.39 available either via the [full] extra, system PATH, environment variables (TYPECODE_LIBMAGIC_PATH, TYPECODE_LIBMAGIC_DB_PATH), or a typecode-libmagic plugin.
  • Low install friction with a pure Python wheel.
  • Actively maintained with recent commits and production-stable status.

License · maintenance · safety

Apache-2.0 (permissive) — Apache-2.0 permissive license allows commercial and private use with minimal restrictions—suitable for most projects.

last release 2026-03-23 (144 days) · last repo commit 2026-04-24 · 10 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 127,394 downloads/mo, #11,745 on PyPI

Verify before relying

pip install typecode

from typecode import identify
result = identify.identify_file('path/to/file')
  • Whether the package's API surface and typical workflows are well-documented beyond the README.
  • Performance characteristics when processing large batches of files or unusual formats.
  • Specific accuracy or edge-case behavior compared to direct libmagic or Pygments use.
Same gist for agents: .md · .json

What it is and what it does

TypeCode is a file type and MIME type detection library that wraps libmagic and Pygments to identify file formats. It started as a library within scancode-toolkit and provides a unified interface for comprehensive filetype detection across Linux, Windows, and macOS.

The package supports multiple installation modes: the [full] extra bundles libmagic binaries for immediate use, while the minimal install expects libmagic to be provided by the system, environment variables, or a plugin. It integrates with the plugincode system to allow custom libmagic providers, making it flexible for environments with non-standard library locations.

Use it for

  • Identify file types in batch processing pipelines without relying on file extensions.
  • Determine MIME types for web servers or content management systems handling user uploads.
  • Integrate file type detection into security scanning or compliance tools.
  • Classify documents by format in archival or document management workflows.
  • Detect and handle PDF and other structured formats via pdfminer.six integration.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Active maintenance, production-stable status, low install friction, no known vulnerabilities, and permissive licensing make it a solid choice. Install with [full] for immediate use, or [minimal] if your environment already provides libmagic 5.39. Best suited for projects needing reliable file type detection beyond filename inspection.

Install

typecode on PyPI

Before you install

Low install friction with a pure Python wheel. Actively maintained with recent commits and production-stable status. Five runtime dependencies including attrs, binaryornot, commoncode, pdfminer.six, and plugincode.

Requires libmagic 5.39 available either via the [full] extra, system PATH, environment variables (TYPECODE_LIBMAGIC_PATH, TYPECODE_LIBMAGIC_DB_PATH), or a typecode-libmagic plugin.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install typecode

from typecode import identify
result = identify.identify_file('path/to/file')

Verify before relying

  • Whether the package's API surface and typical workflows are well-documented beyond the README.
  • Performance characteristics when processing large batches of files or unusual formats.
  • Specific accuracy or edge-case behavior compared to direct libmagic or Pygments use.

Package facts

LicenseApache-2.0 permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
attrsbinaryornotcommoncodepdfminer.sixplugincode
MaintenanceActively maintained 144 days since the last release
Last repo commit
First released
Downloads127,394 / month, #11,745 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software DevelopmentTopic :: Utilities

Evidence: typecode-30.2.0-py3-none-any.whl

Tags

Capabilities
file type detectionmime type detectionlibmagic wrapperfile format identificationmagic number detectionfiletype classifier
Topics
file-identificationlibmagic-wrapper
PyPI keywords
open sourcefiletypemimetypelibmagicscancode-toolkittypecodeutilities

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “libmagic wrapper”

  • typecodeDetects file types and MIME types using libmagic and Pygments, with…
  • pylibmagicProvides pre-compiled libmagic libraries bundled with Python, solving…
  • python-magicIdentifies file types by reading file headers and checking them…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also typecode-libmagic · filetype · libmagic · polyfile-weave · python-magic · file-magic · python-magic-bin · extractcode-libarchive · mediatype · scancode-toolkit