Skip to content

About

💸 💰 OFX, OFC and CSV bank statement formats library in Pascal/Object Pascal for Delphi and Lazarus

Topics

Resources

Stars

70 stars

Watchers

16 watching

Forks

Latest commit

 

History

115 Commits

Folders and files

Repository files navigation

OFX/OFC/CSV Reader

Read OFX (Open Financial Exchange), OFC (Open Financial Connectivity), and CSV bank statement files.

About

  • Importing OFX, OFC, or CSV files allows you to save time in financial management. Instead of typing each transaction manually, you import the statement downloaded from the bank.

  • OFX/OFC file format is widely used in Internet Banking of the leading financial institutions in the world.

  • Compatible with all versions of Delphi / Lazarus.

  • Tested with Delphi Community Edition and Lazarus FPC IDE.

Installation (optional)

For install in your project using boss:

$ boss install github.com/leogregianin/ofx-reader

Example

TOFXReader.Import detects CSV files by their .csv extension, so consumers use the same reader API for every supported format:

Reader.OFXFile := 'statement.csv';
if Reader.Import then
  for I := 0 to Reader.Count - 1 do
    ProcessTransaction(Reader.Get(I));

CSV parsing is implemented in the separate src/uExtratoCsvReader.pas unit and exposed through TOFXReader. It supports quoted fields, comma/semicolon/tab delimiters, UTF-8, UTF-16 and Windows-1252 text, Brazilian and international numeric formats, and common bank-statement column names. CSV support currently targets Delphi builds; OFX/OFC support remains available to Lazarus/FPC consumers.

Simple result:

example1

Dataset result:

example2

JSON result:

example3

Unittest

The Delphi tests (tests/Delphi) require DUnitX, bundled with Delphi since 10 Seattle. Open tests/Delphi/ofxreadertest.dproj, or compile it with dcc32/dcc64, and run the resulting executable.

DUnitX - [ofxreadertest.exe] - Starting Tests.

............................................................................

Tests Found   : 38
Tests Ignored : 0
Tests Passed  : 38
Tests Leaked  : 0
Tests Failed  : 0
Tests Errored : 0

Collaboration

Contribute to improving the project. If you'd like inspiration on projects, check out the Easy-Fix label on the tracker. It holds tasks that can be solved without too much knowledge of the code.

Contributors

Contributors are listed here.

License

MIT License.

About

💸 💰 OFX, OFC and CSV bank statement formats library in Pascal/Object Pascal for Delphi and Lazarus

Topics

Resources

Stars

70 stars

Watchers

16 watching

Forks

Releases

Packages

Contributors

Languages