beccha/ofxparser

OFX file parser

v2.1.0 2024-04-27 20:00 UTC

README

Tests Lint Security Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

This is a fork of oriatec/ofxparser. However, the compatibilty with this library was not preserved.

OFX Parser is a PHP library designed to parse an OFX file downloaded from a financial institution into simple PHP objects.

Here are the OFX Specifications.

Installation

Simply require the package using Composer:

$ composer require beccha/ofxparser

Usage

You can access the nodes in your OFX file as follows:

$ofxParser = new \Beccha\OfxParser\Parser();
$ofx = $ofxParser->loadFromFile('/path/to/your/bankstatement.ofx');

$bankAccounts = $ofx->getBankAccounts();
$firstBankAccount = $bankAccounts[0];

// Get the statement start and end dates
$startDate = $firstBankAccount->getStatement()->getStartDate();
$endDate = $firstBankAccount->getStatement()->getEndDate();

// Get the statement transactions for the account
$transactions = $firstBankAccount->getStatement()->getTransactions();

Contribute

Requirements

You must have docker installed on your system.

Installation

Clone this repository on your system

git clone https://github.com/beccha/ofxparser.git

Start and build a docker container with php7.4:

make start

Deploy Composer packages:

make init

Launch unit tests:

make unit

Other commands

Access shell:

make shell

Please make sure to check the quality of your code before submitting a pull request:

make quality-check

Full list of commands in the Makefile at the root of the project.

Fork & Credits

This is a fork of oriatec/ofxparser, itself forked of okonst/ofxparser, asgrim/ofxparser. Intended to be framework independent.

Loosely based on the ruby ofx-parser by Andrew A. Smith.