Skip to main content

Codec Python Library

The Codec Python library provides convenient access to the Codec API from applications written in Python 3.

Documentation

See the Codec docs.

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, just run:

pip install --upgrade codec-video

Install from source with:

python setup.py install

Requirements

Python 3.10+

Usage

The library needs to be configured with your team's API key which is available in the Codec Dashboard. Instantiate the Codec client with it:

from codec import Codec

codec = Codec("pk_xxx...")

# Get a collection
collection = codec.collections.get("col_xxx...")

# Search within videos in a collection
query = "trump wearing a red hat and talking about north korea"
results = codec.search(
    query=query,
    search_visual=True,
    search_speech=True,
    collection=collection.uid,
    max_results=5
)

Handling exceptions

Unsuccessful requests raise exceptions. The class of the exception will reflect the sort of error that occurred, and the error message will provide more context. See the API reference for a description of the error classes you should handle.

Support

For support, reach out to contact@codec.io.

Metadata

Release files for codec-video 0.1.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 codec-video 0.1.0
File Size Uploaded
codec_video-0.1.0.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codec-video 0.1.0
File Interpreter ABI Platform
codec_video-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / codec_video-0.1.0.tar.gz

Download URL codec_video-0.1.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
786d4c4f6a8eeb6cd7d538482edff3c121977f1bd3bec11f2a16b02261d97f05
BLAKE2b-256 checksum
How to use checksums
8870f9c32389761e55236af4b8dfd89354bffd285fd48cac9fc75c15847f115c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / codec_video-0.1.0-py3-none-any.whl

Download URL codec_video-0.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24e45f9f2b40520eb78f6f1704147e7d8f207757cb1eb0a0664dd7f54dd6a53e
BLAKE2b-256 checksum
How to use checksums
82ae56d6ab620e265b8681a57acf9a1272f4a84c5bef42ac886b70d696a5d80e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

0.1.0 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