Name Trade Republic uploads by statement period
Trade Republic statements all download as document-N.pdf, which says
nothing about what they hold. traderepublic now implements parser.Namer:
it reads the period from the address block at the top of the first page
("DATE 01 May 2025 - 31 Jul 2026") and names the statement
traderepublic_2025_05_01_2026_07_31, lowercase like the NLB names, so the
folder sorts by start date and two downloads of one statement meet under
one name. The transaction table's own DATE heading never matches, since
no date range follows it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -313,15 +313,18 @@ description — at the end, and not in the position it held on the page, so an
|
||||
IBAN wrapped across continuation lines stays contiguous for a glob to match.
|
||||
A new parser must do the same rather than reintroduce a structured field.
|
||||
|
||||
**A parser may name its statements, and only uploads use it.** `parser.Namer`
|
||||
is optional, like `parser.Warner`: `nlb` names an izpisek `izpisek_YYYY_MM_DD`
|
||||
after its *Datum izpiska*, ported from the `rename_izpiski.py` it replaced.
|
||||
`/api/upload` stages each file as a dotfile — invisible to import — so the
|
||||
parser can read it, then numbers a chosen name that is taken by different
|
||||
contents (`_2`, as the script did) where a name the user gave is refused with
|
||||
409. Nothing renames a file already in a folder: `source_files` records
|
||||
statements by path, so a rename would orphan its rows as `missing` until the
|
||||
index is rebuilt. Covered by `TestUploadNamesStatementsTheParserCanName`.
|
||||
**A parser may name its statements, and only uploads use it.** `parser.Namer` is
|
||||
optional, like `parser.Warner`: `nlb` names an izpisek `izpisek_YYYY_MM_DD`
|
||||
after its *Datum izpiska*, ported from the `rename_izpiski.py` it replaced, and
|
||||
`traderepublic` names a statement `traderepublic_YYYY_MM_DD_YYYY_MM_DD` after
|
||||
the period in its header. A name is derived from what the statement says, never
|
||||
from the upload's own name, and comes back without an extension; the upload's is
|
||||
kept, lowercased. `/api/upload` stages each file as a dotfile — invisible to
|
||||
import — so the parser can read it, then numbers a chosen name that is taken by
|
||||
different contents (`_2`, as the script did) where a name the user gave is
|
||||
refused with 409. Nothing renames a file already in a folder: `source_files`
|
||||
records statements by path, so a rename would orphan its rows as `missing` until
|
||||
the index is rebuilt. Covered by `TestUploadNamesStatementsTheParserCanName`.
|
||||
|
||||
## Verifying
|
||||
|
||||
|
||||
Reference in New Issue
Block a user