def csvimport_main():
print('pynYNAB CSV import')
"""Manually import a CSV into a nYNAB budget"""
parser = configargparse.getArgumentParser('pynYNAB')
parser.description=inspect.getdoc(csvimport_main)
parser.add_argument('csvfile', metavar='CSVpath', type=str,
help='The CSV file to import')
parser.add_argument('schema', metavar='schemaName', type=str,
help='The CSV schema to use (see csv_schemas directory)')
parser.add_argument('accountname', metavar='AccountName', type=str,nargs='?',
help='The nYNAB account name to use')
parser.add_argument('-import-duplicates', action='store_true',
help='Forces the import even if a duplicate (same date, account, amount, memo, payee) is found')
args = parser.parse_args()
test_common_args(args)
if not os.path.exists(args.csvfile):
get_logger().error('input CSV file does not exist')
exit(-1)
do_csvimport(args)
评论列表
文章目录