@click.command("<STR_LIT>")<EOL>@click.argument("<STR_LIT:file>")<EOL>def my_import(file):
<EOL>lines = None<EOL>with open(file) as csv_file:<EOL><INDENT>lines = csv_file.readlines()<EOL><DEDENT>header = lines[<NUM_LIT:0>]<EOL>lines.remove(header)<EOL>header = header.rstrip()<EOL>counter = <NUM_LIT:0><EOL>app = AppAggregate()<EOL>app.open_session()<EOL>for line in lines:<EOL><INDENT>line = line.rstrip()<EOL>command = f"<STR_LIT>"<EOL>app.session.execute(command)<EOL>try:<EOL><INDENT>app.save()<EOL><DEDENT>except:<EOL><INDENT>print(f"<STR_LIT>", sys.exc_info()[<NUM_LIT:0>])<EOL>app.session.close()<EOL><DEDENT>counter += <NUM_LIT:1><EOL><DEDENT>print(f"<STR_LIT>")<EOL>
Import Asset Class(es) from a .csv file