Skip to main content

Python package for easily interfacing with MediaCatch APIs and data formats. Documentation can be found at api.mediacatch.io/mediacatch/docs/.

Requirements

Installation

Install the mediacatch CLI with uv

uv tool install mediacatch

To use mediacatch as a library in your own project, add it as a dependency instead

uv add mediacatch

Upgrading

Upgrade the CLI to the latest version

uv tool upgrade mediacatch

If you added mediacatch to a project, upgrade it with

uv sync --upgrade-package mediacatch

Development

Set up the pre-commit hooks (ruff, formatting) with

uv tool install prek && prek install

Getting Started

Firstly, add your MediaCatch API key to your environment variables

export MEDIACATCH_API_KEY=<your-api-key-here>

Then you can start using the command line interface

mediacatch --help
Usage: mediacatch [OPTIONS] COMMAND [ARGS]...

  MediaCatch CLI tool

Options:
  -v, --version         Show program's version number and exit
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.
  -h, --help            Show this message and exit.

Commands:
  speech  CLI tool to run inference with MediaCatch Speech API
  vision  CLI tool to run inference with MediaCatch Vision API
  viz     CLI tool to visualize the results of MediaCatch
  embed   CLI tool to embed files for speech and face recognition with...

Upload a file to MediaCatch Speech API and get the results

mediacatch speech path/to/file --save-result path/to/save/result.json
# or to see options
mediacatch speech --help

Options that take several values, such as --topics, --output-languages and viz --detect-classes, are given once per value

mediacatch speech path/to/file --topics sport --topics news --output-languages en --output-languages de

Upload a file to MediaCatch vision API and get the results

mediacatch vision ocr path/to/file --save-result path/to/save/result.json
# or to see options
mediacatch vision --help

Or import as a module

from mediacatch.vision import upload, wait_for_result

file_id = upload(
  fpath='path/to/file',
  type='ocr',
  # Optional parameters with their default values
  fps=1, # Frames per second for video processing. Defaults to 1.
  tolerance=10, # Tolerance for text detection. Defaults to 10.
  min_bbox_iou=0.5 # Minimum bounding box intersection over union for text detection. Defaults to 0.5.
  min_levenshtein_ratio=0.75 # Minimum Levenshtein ratio for merging text detection (more info here: https://rapidfuzz.github.io/Levenshtein/levenshtein.html#ratio). Defaults to 0.75.
  moving_threshold=50, # If merged text detections center moves more pixels than this threshold, it will be considered moving text. Defaults to 50.
  max_text_length=3, # If text length is less than this value, use max_text_confidence as confidence threshold. Defaults to 3.
  min_text_confidence=0.5, # Confidence threshold for text detection (if text length is greater than max_text_length). Defaults to 0.5.
  max_text_confidence=0.8, # Confidence threshold for text detection (if text length is less than max_text_length). Defaults to 0.8.
  max_height_width_ratio=2.0, # Discard detection if height/width ratio is greater than this value. Defaults to 2.0.
  get_detection_histogram=False, # If true, get histogram of detection. Defaults to False.
  detection_histogram_bins=8, # Number of bins for histogram calculation. Defaults to 8.
)

result = wait_for_result(file_id)

Visualize the results from MediaCatch

mediacatch viz ocr path/to/file path/to/result.json path/to/save.mp4
# or to see options
mediacatch viz --help

Metadata

Release files for mediacatch 0.6.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 mediacatch 0.6.1
File Size Uploaded Provenance Actions
mediacatch-0.6.1.tar.gz 377.7 kB With provenance Details for mediacatch-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mediacatch 0.6.1
File Interpreter ABI Platform Actions
mediacatch-0.6.1-py3-none-any.whl Python 3 none any Details for mediacatch-0.6.1-py3-none-any.whl

Total release size: 571.3 kB

Release files / mediacatch-0.6.1.tar.gz

Download URL mediacatch-0.6.1.tar.gz
Size 377.7 kB
Tags Source
SHA-256 checksum
How to use checksums
76c18e2bbaab8cbc3cfce3e6ed96280d6640d975becc0f5320604e1803cf5cb9
BLAKE2b-256 checksum
How to use checksums
4de8e2b894f9240734a683f05be9e372653f49c475a90c4802f5a85c97bce070
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / mediacatch-0.6.1-py3-none-any.whl

Download URL mediacatch-0.6.1-py3-none-any.whl
Size 193.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abd4b05d0544983ce6521b02e2198b2e3c87a8553fcce99414fa18e3afe9609a
BLAKE2b-256 checksum
How to use checksums
ccc38321e55f5aeaa470ce1d97b28885e478494658f17b9e84b6701bacee8230
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Security for mediacatch 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mediacatch-0.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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