comdirect reader: flatten results

This commit is contained in:
2026-09-10 15:47:32 +02:00
parent bbe70692dd
commit af4becaee9
+3 -2
View File
@@ -47,14 +47,15 @@ def reader_comdirect(path: Path):
elif expect_next == EXPECT_LINE.HEADER:
header = re.findall(PATTERN_HEADER, line)
if header:
result[account_name]["data"] = []
result[account_name] = []
expect_next = EXPECT_LINE.DATA
elif expect_next == EXPECT_LINE.DATA:
data = re.findall(PATTERN_DATA, line)
if data:
result[account_name]["data"].append(
result[account_name].append(
{column: value for column, value in zip(header, data)}
)
else:
expect_next = EXPECT_LINE.ACCOUNT_NAME
else:
expect_next = EXPECT_LINE.ACCOUNT_NAME