14 lines
390 B
Python
Raw Permalink Normal View History

"""Outputters take scraped objects and save them to a certain format."""
2016-11-27 01:52:45 -06:00
from . import json, pickle
OUTPUTTERS = [json, pickle]
def get_outputter(name):
"""Get the outputter with the specified name."""
for outputter in OUTPUTTERS:
if outputter.__name__.endswith(".{}".format(name)):
return outputter
raise Exception("Unknown outputter: {}".format(name))