A CLI tool for indexing video files with programmatic access
Project description
Zapdos
A CLI tool for indexing video files by extracting keyframes that can also be used programmatically.
Installation
To install zapdos, you can use pip:
pip install zapdos
Or if you're using uv:
uv pip install zapdos
Usage
Command Line Interface
After installation, you can use the zapdos command:
zapdos <video_file_path> [--interval <seconds>]
This command will index the specified video file by extracting keyframes at regular intervals.
Programmatic Usage
You can also use zapdos programmatically in your Python code:
from zapdos import index
# Index a video file
try:
frame_paths = index("path/to/your/video.mp4", interval_sec=30)
print(f"Extracted {len(frame_paths)} frames")
except FileNotFoundError as e:
print(f"Error: {e}")
except ValueError as e:
print(f"Error: {e}")
Example
CLI Usage
# Extract frames every 30 seconds (default)
zapdos ./video.mp4
# Extract frames every 10 seconds
zapdos ./video.mp4 --interval 10
Programmatic Usage
from zapdos import index
from pathlib import Path
# Index a video file
video_path = Path("video.mp4")
try:
frame_paths = index(video_path, interval_sec=30)
print(f"Extracted {len(frame_paths)} frames")
for path in frame_paths:
print(f" - {path}")
except FileNotFoundError as e:
print(f"Error: {e}")
except ValueError as e:
print(f"Error: {e}")
Supported Video Formats
Zapdos supports the following video formats:
- MP4 (.mp4)
- AVI (.avi)
- MOV (.mov)
- MKV (.mkv)
- WMV (.wmv)
- FLV (.flv)
- WEBM (.webm)
- M4V (.m4v)
- 3GP (.3gp, .3g2)
- MPG/MPEG (.mpg, .mpeg, .m2v)
Development
To set up the project for development:
- Clone the repository
- Install uv if you haven't already:
pip install uv - Install the package in development mode:
uv pip install --editable .
- Run the CLI tool:
zapdos <video_file_path>
Testing
There are several ways to run the tests:
Using unittest directly:
python tests/test_cli.py
Using pytest (after installing with uv pip install pytest):
pytest tests/
License
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zapdos_py-0.2.0.tar.gz.
File metadata
- Download URL: zapdos_py-0.2.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c95c0f98ce65daacd0929d1c88b0daff585c54dc0279c253e67a9cc3bc402c1
|
|
| MD5 |
188be60c510233d93526507459707afa
|
|
| BLAKE2b-256 |
3f6eca2da354ed5a7d8d652e78cd47ade02132232ef9f075012f4738385e31ac
|
File details
Details for the file zapdos_py-0.2.0-py3-none-any.whl.
File metadata
- Download URL: zapdos_py-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88aef7c76436ee69174db8774298e8154346aee8f669d9797bbe3d835abd62b9
|
|
| MD5 |
ecbea48526b12164e1902426a2438c0e
|
|
| BLAKE2b-256 |
17696b5ddf8a2f6eca5a13c8a997e91ea045c66be28b23d3e0dd42e657b68c6e
|