ysskrishna logoysskrishna

Video Extensions

A fast, honest first filter when a filename might be video.

Built with
PyPI Packages
File & Path Utilities
Python
uv
PyPI
GitHub Actions
Pytest
Details
FreeMIT licenseCreated February 21, 2026Updated November 12, 2026
Share this product

Your pipeline should not open every upload just to learn it was never video.

You get a batch of paths. Some are reports. Some are exports someone renamed. Before you spin up probes or transcodes, you need a cheap answer: does this name look like video at all?

Video Extensions is that first gate. One import, and you can treat bare extensions and full paths the same way.

Know what looks like video before the heavy work starts.

What you get

  • A quick yes or no on extensions and paths so upload validators and ingest jobs can reject obvious mismatches early.
  • Thirty-six known video extensions in one place, including common containers, streaming types, professional formats, and legacy names you forget to add by hand.
  • Case-insensitive, dot-aware matching so .MOV, movie.MP4, and bare mkv strings behave the way you expect.
  • Dotfile-style names handled when the whole filename is effectively the extension, such as a lone .mov path.
  • A shared list you can reuse when you need to iterate allowed types or layer your own rules on top.
  • No extra packages beyond what you already ship, so the check stays small and predictable.

Picture your Monday

Your ingest job watches a folder of uploads. For each filename, you ask whether it looks like video before you queue anything expensive. The obvious text and image files drop out in milliseconds. The rest move on to deeper checks you already trust. An illustrative case, but the pattern is the same in APIs, desktop tools, and batch rename scripts.

Ready to try it?

Frequently asked questions

Why not just keep my own set of five extensions?

You can, until someone uploads .mxf, .m3u8, or .3g2 and your tuple says no while your product team says yes. Maintaining the list in every service drifts. This package holds the same thirty-six extensions the upstream dataset documents so your checks stay aligned.

How do I check if a file is a video in Python?

For a first pass on filenames, use the path and extension helpers in this package. They answer whether the name matches a known video extension. They do not open the file or prove the bytes are video. Pair them with your own deeper checks when security matters.

Is Python's mimetypes module enough?

That depends on what you need. This package gives you a fixed list of thirty-six video extensions you can import, test, and reuse anywhere in your code, including less common containers called out in the project. It still does not read file contents.

Does it detect codecs or what is actually inside the file?

No. It is extension-based heuristics, not container sniffing or codec detection. A misnamed file can fool it either way. Use it as a fast screen, not the only guardrail.

What video formats does it recognize?

Thirty-six extensions, from everyday containers like mp4, mov, avi, mkv, and webm through streaming, professional, legacy, and specialized types listed in the project readme.

How do I install it?

It targets Python 3.8 and up. Install from PyPI as video-extensions, or add it with your usual Python packaging workflow. Details are on the GitHub page and PyPI listing.

Is it free?

Yes. It is open source under the MIT license.

How does this relate to the npm video-extensions list?

It is a Python port of that npm package's dataset. If your stack already trusts that list in JavaScript, you get the same idea in Python without vendoring JSON by hand.

Continue exploring

ProductPyPIBinary Extensions

Binary Extensions

Know which paths look binary in Python, from a curated list of 250+ extensions with no extra dependencies.
File & Path Utilities
PyPI Packages
Python
uv
ProductPyPIUnused Path

Unused Path

Stop overwriting downloads and exports. Get the next free filename, browser style.
File & Path Utilities
PyPI Packages
Python
uv
ProductPyPIText Extensions

Text Extensions

Know which paths look like text before you open them. One shared list, no list upkeep.
File & Path Utilities
PyPI Packages
Python
uv
ProductPyPIStrip BOM

Strip BOM

Invisible UTF-8 marks should not break your parsers, CSV headers, or string checks.
Text & Data Conversion
File & Path Utilities
PyPI Packages
Python
ProductPyPISocial Links

Social Links

Users paste messy profile links. One Python library turns them into clean, comparable URLs.
PyPI Packages
Python
uv
PyPI
ProductPyPINested Utils

Nested Utils

Deep JSON and config paths, one string, no guard maze.
PyPI Packages
Python
uv
PyPI