three_play package

Submodules

three_play.constants module

Project-specific constants

three_play.errors module

Project-specific exception classes

exception three_play.errors.ADIsNotComplete(video_id: str)[source]

Bases: three_play.errors.ThreePlayError

Raised when an Audio Description order is not complete and still in progress.

exception three_play.errors.InvalidLanguageId(language_id, transcript_id)[source]

Bases: three_play.errors.ThreePlayError

Raised when a 3Play transcript has an invalid / unexpected language id.

exception three_play.errors.InvalidSourceLanguage(source_language)[source]

Bases: three_play.errors.ThreePlayError

Raised when a request contains an invalid source language for placing transcript orders.

exception three_play.errors.InvalidTurnaround(turnaround_name)[source]

Bases: three_play.errors.ThreePlayError

Raised when a request contains an invalid 3Play turnaround level

exception three_play.errors.NoSuchMediaFile(video_id)[source]

Bases: three_play.errors.ThreePlayError

Raised when a media file does not exist on 3Play for a given video id

exception three_play.errors.NoSuchTranscript(video_id, has_lang_input=False)[source]

Bases: three_play.errors.ThreePlayError

Raised when a completed transcript order does not exist on 3Play for a given video id

exception three_play.errors.ThreePlayError(message, **log_kwargs)[source]

Bases: Exception

ERR_STATUS = 400
response()[source]

Formats an error object and returns an AWS Lambda Proxy response.

three_play.log module

three_play.log.get_file_logger(filename: str, name=None, level=20, fmt='%(asctime)s - %(levelname)s - %(message)s')[source]

Module contents

A Python library for the 3Play API v3

Usage:

>>> from three_play.v3 import *
>>> from three_play.v3.models import *
>>>
>>> file_data = ThreePlayApi.list_media_files(name_partial='Testing').get('data', [])
>>> files = [MediaFile(**file) for file in file_data]
>>> print(len(files), files)
>>>
>>> transcripts = ThreePlayHelper.get_transcripts('my-video-id')
>>> print(transcripts)
class three_play.NullHandler(level=0)[source]

Bases: logging.Handler

emit(record)[source]

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.