Skip to content

Instantly share code, notes, and snippets.

Created April 2, 2020 14:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Demo of common use of config.LOGGER in ricecooker for testing new colorlogs
#!/usr/bin/env python
from ricecooker.chefs import SushiChef
from ricecooker.classes.nodes import ChannelNode, TopicNode, DocumentNode
from ricecooker.classes.files import DocumentFile
from ricecooker.classes.licenses import get_license
from ricecooker.config import LOGGER'This is a log message par of the script but before chef has started')
class SimpleChef(SushiChef):
channel_info = {
'CHANNEL_TITLE': 'Potatoes info channel',
'CHANNEL_SOURCE_DOMAIN': '<>', # where you got the content
'CHANNEL_SOURCE_ID': '<unique id for channel>', # channel's unique id
'CHANNEL_LANGUAGE': 'en', # le_utils language code
'CHANNEL_THUMBNAIL': '', # (optional)
'CHANNEL_DESCRIPTION': 'What is this channel about?', # (optional)
def construct_channel(self, **kwargs):'This is a log message that is part of the chef run')
channel = self.get_channel(**kwargs)
potato_topic = TopicNode(title="Potatoes!", source_id="<potatos_id>")
doc_node = DocumentNode(
title='Growing potatoes',
description='An article about growing potatoes on your rooftop.',
license=get_license('CC BY', copyright_holder='University of Alberta'),
return channel
if __name__ == '__main__':
Run this script on the command line using:
python -v --reset --token=YOURTOKENHERE9139139f3a23232
simple_chef = SimpleChef()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment