ysskrishna logoysskrishna

Video Extensions

Check if a file or extension is a video type, iterate over 36 known video formats

Treat paths as “video-looking” by extension, no extra packages

When it’s useful

Upload validators, media tools, and asset pipelines often need a quick “is this meant to be video?” signal before heavier probes. Maintaining your own extension list drifts out of sync. This library mirrors the widely used video-extensions npm dataset in Python.

What you can do

  • Check a bare extension or a full path with case-insensitive, dot-aware matching (including dotfiles such as .mov).
  • Cover 36 video extensions called out in the project: common containers, streaming-friendly types, professional formats, and legacy extensions.
  • Keep membership checks cheap with a frozenset backing the API.
  • Import VIDEO_EXTENSIONS / VIDEO_EXTENSIONS_LOWER when you need to iterate or layer custom rules.

Limits and fit

This is extension-based heuristics, not container sniffing or codec detection; misnamed files can fool it either way. Python 3.8+; install from PyPI (video-extensions). Usage and tests are in the GitHub repository.

Frequently asked questions

What is Video Extensions?

It is a zero-dependency Python port of the video-extensions npm dataset. You check whether a bare extension or full path looks like a video type against 36 known video extensions.

How do checks work?

Matching is case-insensitive and dot-aware, including dotfiles such as .mov. Membership uses a frozenset, and you can import VIDEO_EXTENSIONS or VIDEO_EXTENSIONS_LOWER to iterate or layer custom rules.

How do I install it?

Requires Python 3.8+. Install from PyPI with pip install video-extensions, or use uv add video-extensions.

Does it detect codecs or container contents?

No. It is extension-based heuristics, not container sniffing or codec detection. Misnamed files can fool it either way.

Continue exploring

ProductBinary Extensions

Binary Extensions

Check if a file or extension is binary with 250+ known binary types
File & Path Utilities
PyPI Packages
Python
uv
ProductUnused Path

Unused Path

Generate unused file and directory paths by auto-incrementing numeric suffixes
File & Path Utilities
PyPI Packages
Python
uv
ProductText Extensions

Text Extensions

Check if a file or extension is text with 300+ known text types
File & Path Utilities
PyPI Packages
Python
uv
ProductStrip BOM

Strip BOM

Strip UTF-8 byte order mark (BOM) from strings, bytes, streams, and files
Text & Data Conversion
File & Path Utilities
PyPI Packages
Python
ProductNested Utils

Nested Utils

Dot-path access made easy for Python's JSON, dict, and list structures.
PyPI Packages
Python
uv
PyPI
ProductSocial Links

Social Links

Detect, validate, and sanitize social media links in Python
PyPI Packages
Python
uv
PyPI