Video Extensions
Check if a file or extension is a video type, and iterate over 36 known video file formats including mp4, mov, avi, mkv, and more. Python port of video-extensions npm package.
Features
- Immutable collection of 36 known video file extensions
- Fast membership checks using
frozenset - Case-insensitive and dot-aware checks
- Works for both extensions and full file paths
- Supports dotfiles (e.g.,
.mov) - Zero dependencies, minimal overhead
Installation
pip install video-extensions
Or using uv:
uv add video-extensions
Usage
Check if an extension is a video type
from video_extensions import is_video_extension
is_video_extension("mp4") # True
is_video_extension(".mov") # True (dot-aware)
is_video_extension("AVI") # True (case-insensitive)
is_video_extension("txt") # False
Check if a file path has a video extension
from video_extensions import is_video_path
is_video_path("movie.mp4") # True
is_video_path("/path/to/video.MOV") # True (case-insensitive)
is_video_path("presentation.avi") # True
is_video_path("document.txt") # False
is_video_path(".mov") # True (dotfile support)
Access the list of video extensions
from video_extensions import VIDEO_EXTENSIONS, VIDEO_EXTENSIONS_LOWER
# VIDEO_EXTENSIONS is a frozenset of all known video extensions
print(len(VIDEO_EXTENSIONS)) # 36
"mp4" in VIDEO_EXTENSIONS # True
"txt" in VIDEO_EXTENSIONS # False
# VIDEO_EXTENSIONS_LOWER contains all extensions in lowercase
# Useful for case-insensitive lookups without calling .lower() repeatedly
"MP4" in VIDEO_EXTENSIONS_LOWER # True (case-insensitive)
# Iterate over all extensions
for ext in sorted(VIDEO_EXTENSIONS):
print(ext)
Supported Extensions
The package includes support for 36 video file extensions:
- Common formats: mp4, mov, avi, mkv, webm, flv, wmv, mpg, mpeg
- Streaming: m3u8, m4v, m4p, ogv, ogg
- Professional: mxf, drc, aaf, roq
- Legacy: 3gp, 3g2, asf, vob, rm, rmvb, qt
- Specialized: avchd, m2v, mp2, mpe, mpv, mng, nsv, svi, yuv, wmv
Contributing
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct, development setup, and the process for submitting pull requests.
Support
If you find this library helpful:
- ⭐ Star the repository
- 🐛 Report issues
- 🔀 Submit pull requests
- 💝 Sponsor on GitHub
Credits
This package is a Python port of the video-extensions npm package by Sindre Sorhus.
License
MIT © Y. Siva Sai Krishna - see LICENSE for details.
Author's GitHub • Author's LinkedIn • Package on PyPI • GitHub Repository • Report Issues • Changelog • Release History
Metadata
Release files for video-extensions 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| video_extensions-1.0.0.tar.gz | 16.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| video_extensions-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / video_extensions-1.0.0.tar.gz
| Download URL | video_extensions-1.0.0.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b69c342600db0af88bcaad2dd6f6732d10b6bbde2b49f3161685870c95bea958
|
|
BLAKE2b-256 checksum How to use checksums |
635fbd1b2325d16f35427bdc5b65727107688c5d8f26df3f93bcfd253d195539
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / video_extensions-1.0.0-py3-none-any.whl
| Download URL | video_extensions-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef25d25cfd1b749166988980f03d5e42db5acf5d973a197af347dab45f269aae
|
|
BLAKE2b-256 checksum How to use checksums |
d907f00c95e780045cf517a82dcd4a8f4361d99b48e64df2bc1ff31b0ae6a189
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|