Skip to main content

Python Library for the Codec API

Project description

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-sdk

Install from source with:

python setup.py install

Requirements

Python 3.8+

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_types=["visual", "speech"],
    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 support@codec.io.

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

codec_sdk-0.2.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

codec_sdk-0.2.4-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file codec_sdk-0.2.4.tar.gz.

File metadata

  • Download URL: codec_sdk-0.2.4.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for codec_sdk-0.2.4.tar.gz
Algorithm Hash digest
SHA256 6608421a62bc825f2eca4631cbaf130994efa536cf112b9c915ca4767de66d94
MD5 f51dc14de8b20392d06c94d616373b9d
BLAKE2b-256 d9d3227fc542abdcb01cf60a6d45981b1e59aa44d0a22f77ef3f514155313d80

See more details on using hashes here.

File details

Details for the file codec_sdk-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: codec_sdk-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for codec_sdk-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fdc9d73825fe0cece770745669dfaa5b7cd426700ad3c4511ddb8c7f4c024684
MD5 c8f99fafa5e8d11005a9e344e460b06e
BLAKE2b-256 77fd09d57f57b0ce52bcc15ffcfd8fcb69fc747055349233c83a21a4902b4813

See more details on using hashes here.

Supported by

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