PHPackages                             paulovitorbal/php-ynab4 - 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. [API Development](/categories/api)
4. /
5. paulovitorbal/php-ynab4

ActiveLibrary[API Development](/categories/api)

paulovitorbal/php-ynab4
=======================

API to read and write transactions to a YNAB4 json database.

2.0.0(11mo ago)05MITPHP

Since Aug 16Pushed 11mo agoCompare

[ Source](https://github.com/paulovitorbal/php-ynab4)[ Packagist](https://packagist.org/packages/paulovitorbal/php-ynab4)[ Docs](https://github.com/paulovitorbal/php-ynab4)[ RSS](/packages/paulovitorbal-php-ynab4/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

PHP YNAB4 Database
==================

[](#php-ynab4-database)

Read and write transactions from and to a YNAB4 JSON database.

Prerequisites
-------------

[](#prerequisites)

- PHP 5.4+
- composer

Quick start
-----------

[](#quick-start)

Clone repository to disk

```
git clone git@github.com:paulovitorbal/php-ynab4.git

```

Run composer install in order to create necessary libraries

```
cd php-ynab4
composer install

```

Play with the sample application

```
cd sample
php index.php

```

Read transactions
-----------------

[](#read-transactions)

```
# disk driver if you want to access directly on disk the budget database
$io = new YnabDiskIO();

# path to budget folder
$pathToBudget = '/app/ynab/Test~B5C2AEE7.ynab4';
# device id as UUID Version 1, if not provided a new device will be generated
$deviceId = null;
$ynab = new YnabClient($pathToBudget, $io, $deviceId);

# fetch transactions from diff files
$ynab->pull();

# get latest transactions
$transactions = $ynab->getTransactions();

# update device knowledge based on read transactions
$ynab->commit();

# store device id for future calls
$deviceId = $ynab->getDevice()->getDeviceGUID();
```

Write transactions
------------------

[](#write-transactions)

```
# disk driver if you want to access directly on disk the budget database
$io = new YnabDiskIO();

# path to budget folder
$pathToBudget = '/app/ynab/Test~B5C2AEE7.ynab4';
# device id as UUID Version 1, if not provided a new device will be generated
$deviceId = null;
$ynab = new YnabClient($pathToBudget, $io, $deviceId);

$transaction = new YnabTransaction();
$transaction->setAccountId('UUID_ACCOUNT_TO_PUSH_TRANSACTION_TO');
$transaction->setAmount('-10.5');
$transaction->setMemo('Some memo');
$transaction->setDate(new \DateTime());

$ynab->setTransactions([
    $transaction
]);

# Create diff file for other devices to read the new transaction
$ynab->push();

# Update device knowledge based on new generated diff file
$ynab->commit();
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance51

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~2117 days

Total

2

Last Release

345d ago

Major Versions

1.0.0 → 2.0.02025-06-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/b2f6708fcdb9113d0ec7726126a31811669dcb79d5ba2d2edf492c71d2bc92c7?d=identicon)[paulovitorbal](/maintainers/paulovitorbal)

---

Top Contributors

[![paulovitorbal](https://avatars.githubusercontent.com/u/1259996?v=4)](https://github.com/paulovitorbal "paulovitorbal (3 commits)")

---

Tags

apitransactionsbudgetynab4

### Embed Badge

![Health badge](/badges/paulovitorbal-php-ynab4/health.svg)

```
[![Health](https://phpackages.com/badges/paulovitorbal-php-ynab4/health.svg)](https://phpackages.com/packages/paulovitorbal-php-ynab4)
```

###  Alternatives

[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[rebilly/client-php

Rebilly PHP Client

18401.9k](/packages/rebilly-client-php)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)[kabangi/mpesa

M-Pesa API implementation

453.0k2](/packages/kabangi-mpesa)

PHPackages © 2026

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