You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the bug
I have several "Wertpapierübertrag" documents in my account that are identical in their date, title and subtitle (wherefrom the time is extracted). This is nothing unusual if you have transferred multiple different stocks from another broker to Trade Republic.
Subsequently the destination file paths that are created from these data by pytr are identical and thus only one file will be downloaded whilst the others are skipped.
To Reproduce
Steps to reproduce the behavior:
Ran the command pytr dl_docs .
Noticed that the number of downloaded document did not match the expected number of documents
Expected behavior
All files should be downloaded.
E.g. by adding a number if the file already exists.
Alternatively you could extend the --format FORMAT_STRING argument and provide id or body as variables.
This should be sufficient to create unique file names, e.g.: --format "{iso_date}{time} {title}{doc_num} - {id}"
Error log
File ... already in queue. Skipping...
Environment
OS: MacOS
pytr version: 0.1.2
Additional context
Unfortunately these documents do not have a doc_num.
The text was updated successfully, but these errors were encountered:
Just have a look into the code.
In the case that I described, iso_date, time, titleText and subtitleText are identical for the different files and doc_type_num is empty then the filepath will be the same for all the actually different files and we end up with "Skipping...".
filename = self.filename_fmt.format(
iso_date=iso_date, time=time, title=titleText, subtitle=subtitleText, doc_num=doc_type_num
)
if doc_type in ['Kontoauszug', 'Depotauszug']:
filepath = directory / 'Abschlüsse' / f'{filename}' / f'{doc_type}.pdf'
else:
filepath = directory / doc_type / f'{filename}.pdf'
filepath = sanitize_filepath(filepath, '_', 'auto')
if filepath in self.filepaths:
self.log.debug(f'File {filepath} already in queue. Skipping...')
return
else:
self.filepaths.append(filepath)
#29 is a better than the option to add the doc id to every file name. So only in case of duplicate file paths the id is added automatically. (Using the doc id for a cutom file name format is still possible.)
Description of the bug
I have several "Wertpapierübertrag" documents in my account that are identical in their date, title and subtitle (wherefrom the time is extracted). This is nothing unusual if you have transferred multiple different stocks from another broker to Trade Republic.
Subsequently the destination file paths that are created from these data by pytr are identical and thus only one file will be downloaded whilst the others are skipped.
To Reproduce
Steps to reproduce the behavior:
pytr dl_docs .
Expected behavior
All files should be downloaded.
E.g. by adding a number if the file already exists.
Alternatively you could extend the --format FORMAT_STRING argument and provide id or body as variables.
This should be sufficient to create unique file names, e.g.:
--format "{iso_date}{time} {title}{doc_num} - {id}"
Error log
Environment
Additional context
Unfortunately these documents do not have a doc_num.
The text was updated successfully, but these errors were encountered: