Skip to content

Commit 1a798f1

Browse files
authored
Merge pull request pytr-org#28 from britiscurious/master
Added 'id' as an option to format the file name
2 parents c171395 + ff7ff0e commit 1a798f1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pytr/dl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def dl_doc(self, doc, titleText, subtitleText, subfolder=None):
7979

8080
date = doc['detail']
8181
iso_date = '-'.join(date.split('.')[::-1])
82-
82+
doc_id = doc['id']
83+
8384
# extract time from subtitleText
8485
time = re.findall('um (\\d+:\\d+) Uhr', subtitleText)
8586
if time == []:
@@ -104,7 +105,7 @@ def dl_doc(self, doc, titleText, subtitleText, subfolder=None):
104105
subtitleText = subtitleText.replace('\n', '').replace('/', '-')
105106

106107
filename = self.filename_fmt.format(
107-
iso_date=iso_date, time=time, title=titleText, subtitle=subtitleText, doc_num=doc_type_num
108+
iso_date=iso_date, time=time, title=titleText, subtitle=subtitleText, doc_num=doc_type_num, id=doc_id
108109
)
109110
if doc_type in ['Kontoauszug', 'Depotauszug']:
110111
filepath = directory / 'Abschlüsse' / f'{filename}' / f'{doc_type}.pdf'

pytr/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def formatter(prog):
8181
parser_dl_docs.add_argument('output', help='Output directory', metavar='PATH', type=Path)
8282
parser_dl_docs.add_argument(
8383
'--format',
84-
help='available variables:\tiso_date, time, title, doc_num, subtitle',
84+
help='available variables:\tiso_date, time, title, doc_num, subtitle, id',
8585
metavar='FORMAT_STRING',
8686
default='{iso_date}{time} {title}{doc_num}',
8787
)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def readme():
1010

1111
setup(
1212
name='pytr',
13-
version='0.1.4',
13+
version='0.1.5',
1414
description='Use TradeRepublic in terminal',
1515
long_description=readme(),
1616
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)