PHPackages                             leonardocaldas/ofxparser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. leonardocaldas/ofxparser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

leonardocaldas/ofxparser
========================

Simple OFX file parser

v1.0.4(3mo ago)02.7k↑257.1%PHPPHP ^8.2

Since Dec 1Pushed 3mo agoCompare

[ Source](https://github.com/leonardocaldas/ofxparser)[ Packagist](https://packagist.org/packages/leonardocaldas/ofxparser)[ RSS](/packages/leonardocaldas-ofxparser/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

OFX Parser
==========

[](#ofx-parser)

[![Build Status](https://camo.githubusercontent.com/c922048e6dd4d30b8f60d05d23d391b9108c1f13cc8cff489b24f01831461ac7/68747470733a2f2f7472617669732d63692e6f72672f61736772696d2f6f66787061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/asgrim/ofxparser) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/b3ee211e31f8644170f7f322a3259f5836c0faa7f647c8a513fb8fa009a209c9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61736772696d2f6f66787061727365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/asgrim/ofxparser/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/f087f41590a7bfebe73f02a00aab5897a0e35f38324d430de5e0858d31133222/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61736772696d2f6f66787061727365722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/asgrim/ofxparser/?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/36e21d29ec8fe97837e0de18975934fe4bac437a4c9040a76faa9533752879c7/68747470733a2f2f706f7365722e707567782e6f72672f61736772696d2f6f66787061727365722f762f737461626c65)](https://packagist.org/packages/asgrim/ofxparser) [![License](https://camo.githubusercontent.com/5225ba97053b920cba5fb64005aeb1a700d5a0dfef28c98dc33a744cb8e3aee5/68747470733a2f2f706f7365722e707567782e6f72672f61736772696d2f6f66787061727365722f6c6963656e7365)](https://packagist.org/packages/asgrim/ofxparser)

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

It supports multiple Bank Accounts, the required "Sign On" response, and recognises OFX timestamps.

Installation
------------

[](#installation)

Simply require the package using [Composer](https://getcomposer.org/):

```
$ composer require leonardocaldas/ofxparser
```

Usage
-----

[](#usage)

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

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

$bankAccount = reset($ofx->bankAccounts);

// Get the statement start and end dates
$startDate = $bankAccount->statement->startDate;
$endDate = $bankAccount->statement->endDate;

// Get the statement transactions for the account
$transactions = $bankAccount->statement->transactions;
```

Most common nodes are support. If you come across an inaccessible node in your OFX file, please submit a pull request!

Investments Support
-------------------

[](#investments-support)

Investments look much different than bank / credit card transactions. This version supports a subset of the nodes in the OFX 2.0.3 spec, per the immediate needs of the author(s). You may want to reference the OFX documentation if you choose to implement this library. In particular, this does not currently process investment positions (INVPOSLIST) or referenced security definitions (SECINFO).

This is not a pure pass-through of fields, such as this implementation in python: [csingley/ofxtools](https://github.com/csingley/ofxtools). This package contains fields that have been "translated" on occasion to make it more friendly to those less-familiar with the investments OFX spec.

To load investments from a Quicken (QFX) file or a MS Money (OFX / XML) file:

```
// You'll probably want to alias the namespace:

// Load the OFX file
$ofxParser = new \OfxParser\Parsers\Investment();
$ofx = $ofxParser->loadFromFile('/path/to/your/investments_file.ofx');

// Loop over investment accounts (named bankAccounts from base lib)
foreach ($ofx->bankAccounts as $accountData) {
    // Loop over transactions
    foreach ($accountData->statement->transactions as $ofxEntity) {
        // Keep in mind... not all properties are inherited for all transaction types...

        // Maybe you'll want to do something based on the transaction properties:
        $nodeName = $ofxEntity->nodeName;
        if ($nodeName == 'BUYSTOCK') {
            // @see OfxParser\Entities\Investment\Transaction...

            $amount = abs($ofxEntity->total);
            $cusip = $ofxEntity->securityId;

            // ...
        }

        // Maybe you'll want to do something based on the entity:
        if ($ofxEntity instanceof \OfxParser\Entities\Investment\Transaction\BuyStock) {
            // ...
        }

    }
}
```

Fork &amp; Credits
------------------

[](#fork--credits)

This is a fork of [asgrim/ofxparser](https://github.com/asgrim/ofxparser).

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance79

Regular maintenance activity

Popularity21

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Total

5

Last Release

110d ago

PHP version history (2 changes)v1.0.2PHP 8.2.\*

v1.0.4PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17347635?v=4)[Leonardo Caldas](/maintainers/leonardocaldas)[@leonardocaldas](https://github.com/leonardocaldas)

---

Top Contributors

[![asgrim](https://avatars.githubusercontent.com/u/496145?v=4)](https://github.com/asgrim "asgrim (72 commits)")[![loweoj](https://avatars.githubusercontent.com/u/915917?v=4)](https://github.com/loweoj "loweoj (12 commits)")[![ambroisemaupate](https://avatars.githubusercontent.com/u/380026?v=4)](https://github.com/ambroisemaupate "ambroisemaupate (8 commits)")[![moleculezz](https://avatars.githubusercontent.com/u/118499?v=4)](https://github.com/moleculezz "moleculezz (7 commits)")[![leonardocaldas](https://avatars.githubusercontent.com/u/17347635?v=4)](https://github.com/leonardocaldas "leonardocaldas (5 commits)")[![gitmathias](https://avatars.githubusercontent.com/u/365221?v=4)](https://github.com/gitmathias "gitmathias (4 commits)")[![hucharal](https://avatars.githubusercontent.com/u/6876338?v=4)](https://github.com/hucharal "hucharal (4 commits)")[![diegoricardo](https://avatars.githubusercontent.com/u/2482691?v=4)](https://github.com/diegoricardo "diegoricardo (4 commits)")[![nicolasrabier](https://avatars.githubusercontent.com/u/2274443?v=4)](https://github.com/nicolasrabier "nicolasrabier (4 commits)")[![fernando-nery](https://avatars.githubusercontent.com/u/15134576?v=4)](https://github.com/fernando-nery "fernando-nery (2 commits)")[![gwennael-jean](https://avatars.githubusercontent.com/u/4457236?v=4)](https://github.com/gwennael-jean "gwennael-jean (2 commits)")[![renatomb](https://avatars.githubusercontent.com/u/30217311?v=4)](https://github.com/renatomb "renatomb (2 commits)")[![valorin](https://avatars.githubusercontent.com/u/897369?v=4)](https://github.com/valorin "valorin (1 commits)")[![gammamatrix](https://avatars.githubusercontent.com/u/524724?v=4)](https://github.com/gammamatrix "gammamatrix (1 commits)")[![jacques](https://avatars.githubusercontent.com/u/2543?v=4)](https://github.com/jacques "jacques (1 commits)")[![jpswade](https://avatars.githubusercontent.com/u/1087963?v=4)](https://github.com/jpswade "jpswade (1 commits)")[![oceanapplications](https://avatars.githubusercontent.com/u/2704923?v=4)](https://github.com/oceanapplications "oceanapplications (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/leonardocaldas-ofxparser/health.svg)

```
[![Health](https://phpackages.com/badges/leonardocaldas-ofxparser/health.svg)](https://phpackages.com/packages/leonardocaldas-ofxparser)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
