#!/usr/bin/env python # Main Stetl program. # # Author: Just van den Broecke # from stetl.main import parse_args from stetl.etl import ETL from stetl.util import Util from stetl.version import __version__ import sys log = Util.get_log('main') def main(): """The Stetl `main` program, to be called from commandline, like `stetl -c etl.cfg`. Args: -c --config the Stetl config file. -s --section the section in the Stetl config (ini) file to execute (default is [etl]). -a --args zero or more substitutable args for symbolic, {arg}, values in Stetl config file, in format -a arg1=foo -a arg2=bar etc. -v --version Show the current version of stelt and exit -h --help Get component documentation like its configuration parameters, e.g. stetl doc stetl.inputs.fileinput.FileInput """ args = parse_args(sys.argv[1:]) if args.version: print('Stetl version: ', __version__) exit() if args.config_file: # Do the ETL etl = ETL(vars(args), args.config_args) etl.run() else: print('Try stetl -h for help') if __name__ == "__main__": main()