| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A PHP library for parsing Czechoslovak ABO (Account Bank Operations) format files commonly used by Czech and Slovak banks for financial data exchange.
composer require spojenet/abo-parsergit clone https://github.com/Spoje-NET/php-abo-parser.git
cd php-abo-parser
composer installThe library includes a ready-to-use command line tool for converting ABO files to JSON:
# Show help
./Example/abo2json.php --help
# Convert ABO file to JSON (output to stdout)
./Example/abo2json.php --abofile data.abo
# Convert ABO file and save to JSON file
./Example/abo2json.php --abofile data.abo --jsonfile output.json
# Read from stdin and output to stdout
cat data.abo | ./Example/abo2json.php
# Read from stdin and save to file
cat data.abo | ./Example/abo2json.php --jsonfile output.jsonFor a more detailed demonstration, use the included simple example:
# Run the simple example
./Example/simple_example.php path/to/your/file.abo
# Run and save JSON output
./Example/simple_example.php path/to/your/file.abo output.jsonThis script provides a human-readable summary of the parsed data.
<?php
require_once 'vendor/autoload.php';
use SpojeNet\AboParser\AboParser;
// Parse from file
$parser = new AboParser();
$data = $parser->parseFile('path/to/file.abo');
// Parse from string
$aboContent = file_get_contents('path/to/file.abo');
$data = $parser->parse($aboContent);
// Access parsed data
echo "Found " . count($data['statements']) . " account statements\n";
echo "Found " . count($data['transactions']) . " transactions\n";
// Convert to JSON
$json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
echo $json;<?php
use SpojeNet\AboParser\AboParser;
$parser = new AboParser();
$data = $parser->parseFile('bank_statement.abo');
// Process account statements (074 records)
foreach ($data['statements'] as $statement) {
echo "Account: " . $statement['account_number'] . "\n";
echo "Account Name: " . $statement['account_name'] . "\n";
echo "Old Balance: " . $statement['old_balance'] . "\n";
echo "New Balance: " . $statement['new_balance'] . "\n";
echo "Statement Date: " . $statement['accounting_date'] . "\n\n";
}
// Process transactions (075 records)
foreach ($data['transactions'] as $transaction) {
echo "Transaction Amount: " . $transaction['amount'] . "\n";
echo "Counter Account: " . $transaction['counter_account'] . "\n";
echo "Variable Symbol: " . $transaction['variable_symbol'] . "\n";
echo "Date: " . $transaction['valuation_date'] . "\n\n";
}
// Access raw records for debugging
foreach ($data['raw_records'] as $record) {
echo "Line " . $record['line'] . " (Type: " . $record['type'] . "): " . $record['content'] . "\n";
}The parser returns an array with three main sections:
[
'format_version' => 'basic|extended', // Detected ABO format version
'statements' => [...], // Parsed account statements (074 records)
'transactions' => [...], // Parsed transactions (075 records)
'raw_records' => [...] // Raw line data for debugging
][
'record_type' => '074',
'account_number' => '0000000002122722',
'account_name' => 'Account Holder Name',
'old_balance_date' => '2025-08-20',
'old_balance' => 99474.70,
'old_balance_sign' => '+',
'new_balance' => 93201.15,
'new_balance_sign' => '+',
'debit_turnover' => 6273.55,
'debit_turnover_sign' => '+',
'credit_turnover' => 0.00,
'credit_turnover_sign' => '+',
'statement_number' => '027',
'accounting_date' => '2025-08-21',
'raw_line' => '074...'
][
'record_type' => '075',
'format' => 'basic',
'account_number' => '0000000002122722',
'counter_account' => '0000000100785108',
'document_number' => '0001865283798',
'amount' => 110.00,
'accounting_code' => '1',
'variable_symbol' => '5174658167',
'constant_symbol' => '0003000308',
'specific_symbol' => '0000000000',
'valuation_date' => '2025-08-21',
'additional_info' => '',
'change_code' => '0',
'data_type' => '1101',
'due_date' => '2025-08-21',
'raw_line' => '075...'
][
// ... all basic fields ...
'format' => 'extended',
'message_for_recipient' => 'Payment description',
'message_for_recipient_2' => 'Additional info line 2',
'message_for_recipient_3' => 'Additional info line 3',
'message_for_recipient_4' => 'Additional info line 4',
'message_for_sender' => 'Internal note',
'debited_date' => '2025-08-21',
'item_description' => 'Transaction type',
'identification_reference' => 'REF123456789',
'amount_iso' => 110.00,
'currency_iso' => 'CZK',
'counter_account_name' => 'Recipient Bank Name',
// ... and many more extended fields
]The ABO format is a fixed-width text format used in Czech and Slovak banking systems. This library supports:
There are two versions of the ABO format:
Format Detection: The parser automatically detects which format is being used by analyzing the length of 075 records. No manual configuration is required.
# Install dev dependencies
composer install
# Run tests
vendor/bin/phpunit tests
# OR
make tests# Static analysis
vendor/bin/phpstan analyse --configuration=phpstan-default.neon.dist --memory-limit=-1
# OR
make static-code-analysis
# Code formatting
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --verbose --allow-risky=yes
# OR
make cs# Show all available commands
make helpThis project is licensed under the MIT License - see the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |