API reference¶
The importable Python surface: the loading and summary functions, the
CfonbSummary dataclass, and CfonbStatementParser, the
BankStatementParser the core discovers through the cfonb and
afb120 entry points in bankstatementparser.loaders.
Generated from the docstrings by mkdocstrings.
bankstatementparser_loader_cfonb.loader
¶
Core CFONB 120 / AFB120 Fixed-Width Banking Statement Loader.
CfonbSummary
dataclass
¶
Financial and header summary for a parsed CFONB 120 statement.
Source code in bankstatementparser_loader_cfonb/loader.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
CfonbStatementParser
¶
Bases: BankStatementParser
BankStatementParser plugin implementation for French CFONB 120 statements.
Source code in bankstatementparser_loader_cfonb/loader.py
333 334 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 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | |
__init__(file_name, **kwargs)
¶
Initialize the CFONB statement parser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name
|
str | Path
|
Path to the CFONB 120 statement file. |
required |
**kwargs
|
Any
|
Extra options passed to the base parser. |
{}
|
Source code in bankstatementparser_loader_cfonb/loader.py
336 337 338 339 340 341 342 343 344 | |
parse()
¶
Parse the CFONB file into a pandas DataFrame.
Returns:
| Type | Description |
|---|---|
DataFrame
|
A pandas DataFrame containing standardized statement transactions. |
Source code in bankstatementparser_loader_cfonb/loader.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | |
to_transactions()
¶
Parse the CFONB file into a list of Transaction models.
Returns:
| Type | Description |
|---|---|
list[Transaction]
|
List of parsed Transaction instances. |
Source code in bankstatementparser_loader_cfonb/loader.py
380 381 382 383 384 385 386 | |
get_summary()
¶
Get summary metadata and balance metrics for the CFONB file.
Returns:
| Type | Description |
|---|---|
CfonbSummaryRecord
|
Statement statistics. |
CfonbSummaryRecord
|
are |
CfonbSummaryRecord
|
as |
Source code in bankstatementparser_loader_cfonb/loader.py
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | |
load_cfonb(text_or_lines)
¶
Parse CFONB 120 formatted text into a list of Transaction models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_or_lines
|
str | Iterable[str]
|
Raw CFONB string or iterable of lines. |
required |
Returns:
| Type | Description |
|---|---|
list[Transaction]
|
List of parsed Transaction domain models. |
Source code in bankstatementparser_loader_cfonb/loader.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | |
load_cfonb_file(path)
¶
Read and parse a CFONB 120 statement file from disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | PathLike[str]
|
Path to the CFONB file. |
required |
Returns:
| Type | Description |
|---|---|
list[Transaction]
|
List of parsed Transaction domain models. |
Source code in bankstatementparser_loader_cfonb/loader.py
279 280 281 282 283 284 285 286 287 288 289 | |
summarize_cfonb(text_or_lines)
¶
Generate a structured financial summary for a CFONB statement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text_or_lines
|
str | Iterable[str]
|
Raw CFONB string or iterable of lines. |
required |
Returns:
| Type | Description |
|---|---|
CfonbSummary
|
A CfonbSummary dataclass containing balances, dates, and aggregates. |
Source code in bankstatementparser_loader_cfonb/loader.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | |