Skip to main content

A CLI tool for indexing video files with programmatic access

Project description

Zapdos-Py

A CLI tool for indexing video files by extracting keyframes that can also be used programmatically.

Installation

To install zapdos-py, you can use pip:

pip install zapdos-py

Or if you're using uv:

uv pip install zapdos-py

Usage

Command Line Interface

After installation, you can use the zapdos-py command:

zapdos-py <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-py programmatically in your Python code:

from zapdos_py 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-py ./video.mp4

# Extract frames every 10 seconds
zapdos-py ./video.mp4 --interval 10

Programmatic Usage

from zapdos_py 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-Py 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:

  1. Clone the repository
  2. Install uv if you haven't already: pip install uv
  3. Install the package in development mode:
    uv pip install --editable .
    
  4. Run the CLI tool:
    zapdos-py <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

zapdos_py-0.2.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zapdos_py-0.2.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file zapdos_py-0.2.1.tar.gz.

File metadata

  • Download URL: zapdos_py-0.2.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for zapdos_py-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ce43364d2b7b77a438b181b52594c8db212704c6cd8fe4a7527760c31ae2e8b5
MD5 abc1d900018fd4bfeae2d8b52aae5407
BLAKE2b-256 05b337c1d707c7e8b1dbc9411f4beec96ccc4585d1b8c0c5b9ed70bfb031e806

See more details on using hashes here.

File details

Details for the file zapdos_py-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: zapdos_py-0.2.1-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

Hashes for zapdos_py-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ac265e4ccaa519f4ab9f8a9b1122645969a6afbf9cbd9bc01a93447ace33a03
MD5 3c6e43f0ba762b40a066bdfc7ecbab9e
BLAKE2b-256 133ae34144ab88d51eb2f576c296b92059f0fbf9912581fe257b2022f9e28bab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page