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.7.0

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.7.0
File Size Uploaded Provenance Actions
mediacatch-0.7.0.tar.gz 332.8 kB With provenance Details for mediacatch-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 527.8 kB

Release files / mediacatch-0.7.0.tar.gz

Download URL mediacatch-0.7.0.tar.gz
Size 332.8 kB
Tags Source
SHA-256 checksum
How to use checksums
66ae5b6063520cb8ecfe5d8085ba28903e71b9420d7cf20fe433e28592a209a2
BLAKE2b-256 checksum
How to use checksums
17268c9239333605566601a56bfc342c7b4004dba8351c874356442919d0a757
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

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

Download URL mediacatch-0.7.0-py3-none-any.whl
Size 194.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d4ebee38d7cebc3eb298401d2085b8335bedbd7b5b0b6a58211d75e95edd5cb
BLAKE2b-256 checksum
How to use checksums
e2e332c1a73cd4fdeae9d0730f41fcd0bf4182814ecd9d424ab2d375ff8a5220
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 26, 2026.

Transparency log

Security for mediacatch 0.7.0

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.7.0.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 26, 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