@@ -0,0 +1,1171 @@
+import argparse%0Aimport requests%0Aimport os.path%0Aimport sys%0Aimport yaml%0Aimport logging%0Aimport functools%0Afrom logging.config import dictConfig%0Afrom requests.adapters import HTTPAdapter%0Afrom .bridge import APIDataBridge%0Afrom .contrib.storage import Storage%0Afrom .contrib.workers import Fetch, Save%0Afrom .helpers import check_doc%0A%0A%0AADAPTER = HTTPAdapter(pool_maxsize=50, pool_connections=100)%0ASESSION = requests.Session()%0ALOGGER = logging.getLogger(__name__)%0A%0A%0Adef run():%0A    parser = argparse.ArgumentParser('API databridge')%0A    parser.add_argument('-c', '--config', required=True)%0A    args = parser.parse_args()%0A%0A    if not os.path.exists(args.config):%0A        print %22Not a valid config%22%0A        sys.exit(1)%0A%0A    with open(args.config) as cfg:%0A        config = yaml.load(cfg)%0A    if 'logging' in config:%0A        dictConfig(config%5B'logging'%5D)%0A    else:%0A        logging.basicConfig(level=logging.INFO)%0A    storage = Storage(config, session=SESSION, adapter=ADAPTER)%0A    filter_func = functools.partial(check_doc, storage.db)%0A    bridge = APIDataBridge(config, filter_feed=filter_func)%0A    bridge.add_worker(Fetch, config)%0A    bridge.add_worker(Save, config)%0A    bridge.run()%0A

Add run script