def main(): parser = argparse.ArgumentParser(description='ETL(es to odbc)') parser.add_argument('--conf', '--conf-dir', required=True) parser.add_argument('--profile', required=True) parser.add_argument('--body', required=True) parser.add_argument('--optimize', action='store_true', default=False) from settings import configure_logging configure_logging() config = Configuration(vars(parser.parse_args())) extractor = etl_es.ElasticsearchDataExtractor(config) transformer = etl.SimpleDataTransformer(config) loader = etl_odbc.ODBCDataLoader(config) etl.etl(config, extractor, transformer, loader)
def main(): parser = argparse.ArgumentParser(description='ETL(mongo to es)') parser.add_argument('--conf', '--conf-dir', required=True) parser.add_argument('--query', required=True) parser.add_argument('--profile', required=False) parser.add_argument('--optimize', action='store_true', default=False) parser.add_argument('--index-template-name', required=False) parser.add_argument('--index-settings', required=False) parser.add_argument('--settings', required=False, default='{}') from settings import configure_logging configure_logging() config = Configuration(vars(parser.parse_args())) extractor = etl_mongo.MongoDataExtractor(config) transformer = etl.SimpleDataTransformer(config) loader = etl_es.ElasticsearchDataLoader(config) etl.etl(config, extractor, transformer, loader)
def main(): parser = argparse.ArgumentParser(description='ETL(mongo to mongo)') parser.add_argument('--conf', '--conf-dir', required=True) parser.add_argument('--query', required=True) parser.add_argument('--profile', required=False) parser.add_argument('--optimize', action='store_true', default=False) parser.add_argument('--update', action='store_true', default=False) parser.add_argument('--settings', required=False, default='{}') from settings import configure_logging configure_logging() args = parser.parse_args() config = Configuration(vars(args)) extractor = etl_mongo.MongoDataExtractor(config) if args.update: transformer = etl_mongo.MongoUpdateDataTransformer(config) loader = etl_mongo.MongoUpdateDataLoader(config) else: transformer = etl.SimpleDataTransformer(config) loader = etl_mongo.MongoDataLoader(config) etl.etl(config, extractor, transformer, loader)