formatting
This commit is contained in:
parent
977f82a2a4
commit
f3bdd475bc
1 changed files with 3 additions and 3 deletions
|
@ -13,7 +13,7 @@ import sys
|
||||||
@click.command(name="import")
|
@click.command(name="import")
|
||||||
@click.option("--filetype", "-t", type=click.Choice(["dkb", "sparkasse-mt940", "bunq-csv"], case_sensitive=False))
|
@click.option("--filetype", "-t", type=click.Choice(["dkb", "sparkasse-mt940", "bunq-csv"], case_sensitive=False))
|
||||||
@click.option("--profile", "-p")
|
@click.option("--profile", "-p")
|
||||||
@click.option("--force","-f", default=False, is_flag=True)
|
@click.option("--force", "-f", default=False, is_flag=True)
|
||||||
@click.argument("filename", type=click.Path(exists=True))
|
@click.argument("filename", type=click.Path(exists=True))
|
||||||
def command(filename, profile, force, filetype):
|
def command(filename, profile, force, filetype):
|
||||||
session = get_session(profile)
|
session = get_session(profile)
|
||||||
|
@ -57,12 +57,12 @@ def command(filename, profile, force, filetype):
|
||||||
print(".", end="", flush=True)
|
print(".", end="", flush=True)
|
||||||
|
|
||||||
elif filetype == "dkb":
|
elif filetype == "dkb":
|
||||||
with open(click.format_filename(filename), encoding='ISO-8859-1') as fh:
|
with open(click.format_filename(filename), encoding="ISO-8859-1") as fh:
|
||||||
csv_reader = csv.reader(fh, delimiter=";")
|
csv_reader = csv.reader(fh, delimiter=";")
|
||||||
next(csv_reader, None)
|
next(csv_reader, None)
|
||||||
for line in csv_reader:
|
for line in csv_reader:
|
||||||
date = datetime.strptime(line[0], "%d.%m.%Y")
|
date = datetime.strptime(line[0], "%d.%m.%Y")
|
||||||
amount = int(line[7].replace(".","").replace(",", ""))
|
amount = int(line[7].replace(".", "").replace(",", ""))
|
||||||
iban = line[5]
|
iban = line[5]
|
||||||
name = line[3]
|
name = line[3]
|
||||||
description = line[4]
|
description = line[4]
|
||||||
|
|
Loading…
Add table
Reference in a new issue