Skip to main content

drama-slicer

Python library and backend-callable API for processing video/audio files into transcript-aware video Slice objects.

Install the published package with uv add drama-slicer or pip install drama-slicer. The distribution name is drama-slicer; the Python import package remains slicer.

Preparation

# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt update
sudo apt install ffmpeg

# Python deps
uv sync

Local execution

uv run src/main.py data/input/Popeye_forPresident_512kb.mp4

The command prints the generated manifest path when processing succeeds.

Tests

uv --cache-dir /private/tmp/uv-cache run python -m unittest discover -s tests

The test suite uses real ffprobe, ffmpeg, and WhisperX execution. The end-to-end test verifies that all slices continuously cover the original video duration. Test outputs are grouped under data/output/tests/<video-name>/. Repeated exports replace previous manifest and slice files for the same video name.

Python API

from slicer import slice_video_to_output

manifest_path = slice_video_to_output(
    "data/input/Popeye_forPresident_512kb.mp4",
    output_dir="data/output",
    include_video=True,
)

slice_video_to_output() is the only public Python API. It uses local WhisperX to generate transcript timestamps, builds continuous slices that cover the original video timeline, and writes the result to disk. Other modules, models, and helper functions are internal implementation details.

Output format:

  • data/output/<video-name>/*_manifest.json: index of all slices, timestamps, text files, optional video files, and sentence data.
  • data/output/<video-name>/*_slice_0000_00000_000-00012_000.txt: transcript lines for each slice.
  • data/output/<video-name>/*_slice_0000_00000_000-00012_000.mp4: video slice when include_video=True, which is the default for slice_video_to_output().

Packaging

uv build

Metadata

Release files for drama-slicer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drama-slicer 0.1.1
File Size Uploaded
drama_slicer-0.1.1.tar.gz 199.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for drama-slicer 0.1.1
File Interpreter ABI Platform
drama_slicer-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 210.0 kB

Release files / drama_slicer-0.1.1.tar.gz

Download URL drama_slicer-0.1.1.tar.gz
Size 199.5 kB
Tags Source
SHA-256 checksum
How to use checksums
91feb08c3b8be0abb67096fe573d4221714eecfdf52c6620fc56d19fa4bfcaf6
BLAKE2b-256 checksum
How to use checksums
8b3431f5f0677554e428102e91b83389cc3f772420d418b7acffa5e31762e565
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / drama_slicer-0.1.1-py3-none-any.whl

Download URL drama_slicer-0.1.1-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47e18e64b8c2cb19b16cc4b98dd102a362ec63b81b459ecf031d0f83f922f781
BLAKE2b-256 checksum
How to use checksums
c5ec46284a2cefd57d95d8e9a960344e1ce97670227708c4b0313ea0421a4ff6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page