--- id: identify version: "2.6.19" license: MIT license_treatment: permissive maintenance: active --- # identify — File identification library for Python License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install identify uv add identify poetry add identify ## Description [![build status](https://github.com/pre-commit/identify/actions/workflows/main.yml/badge.svg)](https://github.com/pre-commit/identify/actions/workflows/main.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pre-commit/identify/main.svg)](https://results.pre-commit.ci/latest/github/pre-commit/identify/main) identify ======== File identification library for Python. Given a file (or some information about a file), return a set of standardized tags identifying what the file is. ## Installation ```bash pip install identify ``` ## Usage ### With a file on disk If you have an actual file on disk, you can get the most information possible (a superset of all other methods): ```python >>> from identify import identify >>> identify.tags_from_path('/path/to/file.py') {'file', 'text', 'python', 'non-executable'} >>> identify.tags_from_path('/path/to/file-with-shebang') {'file', 'text', 'shell', 'bash', 'executable'} >>> identify.tags_from_path('/bin/bash') {'file', 'binary', 'executable'} >>> identify.tags_from_path('/path/to/directory') {'directory'} >>> identify.tags_from_path('/path/to/symlink') {'symlink'} ``` When using a file on disk, the checks... ## AI interpretation — verify before relying Identifies file types by examining file paths, names, shebangs, and content, returning standardized tags for classification. Optionally identifies license types from LICENSE files. Verdict: Lightweight, actively maintained file identification library with no dependencies and permissive licensing. Suitable for build tools, linters, and file-processing workflows. No known vulnerabilities and top-1000 PyPI popularity. [View on SkillFed](https://skillfed.io/packages/identify) · [View on PyPI](https://pypi.org/project/identify/)