-parser.add_argument("-c", "--config",
- default="config.ini",
- required=False,
- help="Config file to load (default: config.ini)")
-parser.add_argument("--before",
- default=False, action='store_const', const=True,
- help="Run the steps before the cryptoportfolio update")
-parser.add_argument("--after",
- default=False, action='store_const', const=True,
- help="Run the steps after the cryptoportfolio update")
-parser.add_argument("--debug",
- default=False, action='store_const', const=True,
- help="Run in debug mode")
-
-args = parser.parse_args()
-
-if not os.path.exists(args.config):
- print("no config file found, exiting")
- sys.exit(1)
-
-config = configparser.ConfigParser()
-config.read(args.config)
-
-pg_config = config["postgresql"]
-
-connection = psycopg2.connect(**pg_config)
-cursor = connection.cursor()
-
-cursor.execute("SELECT config,user_id FROM market_configs")
-
-report_path = config["app"]["report_path"]
-if not os.path.exists(report_path):
- os.makedirs(report_path)
-
-for row in cursor:
- market_config, user_id = row