ricecooker package

Submodules

ricecooker.classes module

ricecooker.commands module

ricecooker.commands.uploadchannel(path, domain, verbose=False)[source]

guess_content_kind: determines what kind the content is :param path: path to file containing channel data :type path: str :param verbose: indicates whether to print process :type verbose: bool

Returns: (str) link to access newly created channel

ricecooker.config module

ricecooker.config.create_channel_url(domain)[source]
ricecooker.config.file_diff_url(domain)[source]
ricecooker.config.file_upload_url(domain)[source]
ricecooker.config.get_storage_path(filename)[source]
ricecooker.config.open_channel_url(invitation, channel, domain)[source]

ricecooker.exceptions module

exception ricecooker.exceptions.FileNotFoundException(*args, **kwargs)[source]

Bases: Exception

exception ricecooker.exceptions.InvalidCommandException(*args, **kwargs)[source]

Bases: Exception

exception ricecooker.exceptions.InvalidFormatException(*args, **kwargs)[source]

Bases: Exception

exception ricecooker.exceptions.InvalidInputAnswerException(*args, **kwargs)[source]

Bases: Exception

exception ricecooker.exceptions.InvalidUsageException(*args, **kwargs)[source]

Bases: Exception

exception ricecooker.exceptions.MissingKeyException(*args, **kwargs)[source]

Bases: Exception

exception ricecooker.exceptions.UnknownContentKindError(*args, **kwargs)[source]

Bases: Exception

exception ricecooker.exceptions.UnknownQuestionTypeError(*args, **kwargs)[source]

Bases: Exception

ricecooker.exceptions.raise_for_invalid_channel(channel)[source]

ricecooker.managers module

class ricecooker.managers.ChannelManager(channel, domain, verbose=False)[source]

Bases: object

get_file_diff()[source]
process_tree(node, parent=None)[source]
upload_files(file_list)[source]
upload_tree()[source]
class ricecooker.managers.DownloadManager(verbose=False)[source]

Bases: object

all_file_extensions = ['mp4', 'vtt', 'srt', 'mp3', 'wav', 'pdf', 'jpg', 'jpeg', 'png', 'json', 'svg', 'perseus']
download_file(path, hash=None, default_ext='.png', preset=None, force_ext=False)[source]

download_file: downloads files to local storage @param files (list of files to download) @return list of file hashes and extensions

download_files(files)[source]

download_files: downloads files to local storage @param files (list of files to download) @return list of file hashes and extensions

download_graphie(path)[source]

download_file: downloads files to local storage @param files (list of files to download) @return list of file hashes and extensions

download_image(path)[source]
encode_thumbnail(thumbnail)[source]

encode_thumbnail: gets base64 encoding of thumbnail :param thumbnail: file path or url to channel’s thumbnail :type thumbnail: str

Returns: base64 encoding of thumbnail

get_file_mapping()[source]
get_files()[source]
get_hash(request, hash_to_update)[source]
session = <requests.sessions.Session object>

ricecooker.sample_program module

ricecooker.sample_program.construct_channel(args)[source]
ricecooker.sample_program.create_question(raw_question)[source]

Module contents