identify
File identification library for Python
Decision gist · record as of 2026-08-14
Yes. identify is lightweight, actively maintained, has no dependencies, and solves a common problem in build automation and file processing. It is widely used in the pre-commit ecosystem and carries no known vulnerabilities. Install it if you need reliable, standardized file classification.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low friction: pure Python wheel with no runtime dependencies.
- Active maintenance with recent releases and steady commit activity.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for most projects.
last release 2026-04-17 (119 days) · last repo commit 2026-07-15 · 297 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 185,751,370 downloads/mo, #222 on PyPI
Alternatives
Verify before relying
pip install identify
from identify import identify
tags = identify.tags_from_path('/path/to/file.py')
print(tags) # {'file', 'text', 'python', 'non-executable'}- Accuracy of license identification against real-world LICENSE files and edge cases.
- Performance characteristics when processing large files or directories.
What it is and what it does
identify is a file classification library that examines files on disk (or filenames alone) and returns a set of standardized tags describing what the file is. It checks file type, executability, extension, shebang content, and binary vs. text status in a deliberate order to avoid unnecessary file reads. It also includes an optional license identification API that normalizes and matches license text against SPDX identifiers sourced from choosealicense.com.
The library is designed for tools that need to route files to appropriate handlers—build systems, linters, pre-commit hooks, and similar automation. It exposes three main APIs: tags_from_path for files on disk (most complete), tags_from_filename for extension-only matching, and tags_from_interpreter for shebang-based identification. A CLI tool is also included for command-line use.
Use it for
- Determine whether a file is executable or binary before processing it in a build or test pipeline.
- Classify files by language or type to route them to the correct linter or formatter.
- Identify the interpreter from a shebang to validate or document script dependencies.
- Detect and classify LICENSE files by SPDX identifier for license compliance checks.
- Pre-commit hooks that need to skip or handle certain file types differently.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
identify is lightweight, actively maintained, has no dependencies, and solves a common problem in build automation and file processing. It is widely used in the pre-commit ecosystem and carries no known vulnerabilities. Install it if you need reliable, standardized file classification.
Install
identify on PyPI
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance with recent releases and steady commit activity.
Requires Python 3.10 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for most projects.
Quickstart
pip install identify
from identify import identify
tags = identify.tags_from_path('/path/to/file.py')
print(tags) # {'file', 'text', 'python', 'non-executable'}
Verify before relying
- Accuracy of license identification against real-world LICENSE files and edge cases.
- Performance characteristics when processing large files or directories.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 119 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 185,751,370 / month, #222 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: identify-2.6.19-py2.py3-none-any.whl
Tags
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 › “identify file format”
- identifyIdentifies file types by examining file paths, names, shebangs, and…
- standard-imghdrProvides the `imghdr` module, a Python standard library utility…
- filetypeInfers file type and MIME type by examining magic number signatures…
Give your agent the search over MCP, or paste the wish link into any chat.
Similar packages
Parse, compile, and match FLIRT signatures (Fast Library Identification and Recognition Technology) against byte sequences to recognize statically-linked code without IDA Pro.
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.
Identifies whether a string contains Simplified Chinese, Traditional Chinese, both, or mixed character sets using CC-CEDICT data.
Identifies file types by analyzing magic numbers and file content, with zero runtime dependencies and cross-platform support.
Parses Ruby Gemfiles, .gemspec files, and Cocoapod .podspec files from Python, extracting dependency information organized by group.
However, verify that it handles your target Ruby syntax versions and that dormancy (last release August 2024, last commit September 2024) does not signal abandonment…
Discovers Python interpreters installed on your system across multiple sources (system packages, pyenv, mise, asdf, uv, Windows registry) and returns detailed metadata about matches to version requirements.
Install it if your tool or workflow needs to programmatically discover or verify Python interpreters.
See also py3langid · crawlerdetect · flake8-executable · shellingham