def get_renderer_class(renderer): if renderer == 'text': return renderers.ConsoleRenderer elif renderer == 'html': return renderers.HTMLRenderer elif renderer == 'json': return renderers.JSONRenderer else: return object_with_import_path(renderer)