API reference¶
The importable Python surface: the loading and summary functions, the
SepaMessageSummary dataclass, and SepaStatementParser, the
BankStatementParser the core discovers through the sepa, pain002
and pain008 entry points in bankstatementparser.loaders. Generated
from the docstrings by mkdocstrings.
bankstatementparser_loader_sepa.loader
¶
Core ISO 20022 SEPA PAIN.002 & PAIN.008 Statement Loader.
SepaMessageSummary
dataclass
¶
Summary metrics and headers for a SEPA PAIN.002 or PAIN.008 message.
Source code in bankstatementparser_loader_sepa/loader.py
66 67 68 69 70 71 72 73 74 75 76 | |
SepaStatementParser
¶
Bases: BankStatementParser
BankStatementParser plugin implementation for SEPA PAIN.002 & PAIN.008 XML files.
Source code in bankstatementparser_loader_sepa/loader.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | |
__init__(file_name, **kwargs)
¶
Initialize the SEPA parser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name
|
str | Path
|
Path to the SEPA XML file. |
required |
**kwargs
|
Any
|
Extra options passed to base parser. |
{}
|
Source code in bankstatementparser_loader_sepa/loader.py
406 407 408 409 410 411 412 413 414 | |
parse()
¶
Parse the SEPA file into a pandas DataFrame.
Returns:
| Type | Description |
|---|---|
DataFrame
|
A pandas DataFrame containing standardized statement transactions. |
Source code in bankstatementparser_loader_sepa/loader.py
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | |
to_transactions()
¶
Parse the SEPA file into a list of Transaction models.
Returns:
| Type | Description |
|---|---|
list[Transaction]
|
List of parsed Transaction instances. |
Source code in bankstatementparser_loader_sepa/loader.py
450 451 452 453 454 455 456 | |
get_summary()
¶
Get summary metadata and metrics for the SEPA file.
Returns:
| Type | Description |
|---|---|
SepaSummaryRecord
|
Message statistics. |
SepaSummaryRecord
|
|
Source code in bankstatementparser_loader_sepa/loader.py
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | |
load_sepa(xml_content)
¶
Parse a SEPA PAIN.002 or PAIN.008 XML payload into Transaction objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xml_content
|
str | bytes
|
XML payload string or bytes. |
required |
Returns:
| Type | Description |
|---|---|
list[Transaction]
|
List of parsed Transaction instances. |
Source code in bankstatementparser_loader_sepa/loader.py
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
load_sepa_file(path)
¶
Read and parse a SEPA PAIN.002 / PAIN.008 file from disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | PathLike[str]
|
Path to the SEPA XML file. |
required |
Returns:
| Type | Description |
|---|---|
list[Transaction]
|
List of Transaction instances. |
Source code in bankstatementparser_loader_sepa/loader.py
365 366 367 368 369 370 371 372 373 374 375 | |
summarize_sepa(xml_content)
¶
Generate financial and message summary for a SEPA document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xml_content
|
str | bytes
|
XML payload string or bytes. |
required |
Returns:
| Type | Description |
|---|---|
SepaMessageSummary
|
A SepaMessageSummary instance. |
Source code in bankstatementparser_loader_sepa/loader.py
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |