{"id":30810433,"url":"https://github.com/spoje-net/php-abo-parser","last_synced_at":"2026-01-20T16:33:51.113Z","repository":{"id":313356049,"uuid":"1051033718","full_name":"Spoje-NET/php-abo-parser","owner":"Spoje-NET","description":"ABO Format parsing library","archived":false,"fork":false,"pushed_at":"2025-09-05T13:01:56.000Z","size":287,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-05T15:18:22.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Spoje-NET.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-05T10:38:20.000Z","updated_at":"2025-09-05T13:02:00.000Z","dependencies_parsed_at":"2025-09-05T15:18:33.842Z","dependency_job_id":"140ccb93-479b-4292-a236-4b45c0ae3c6f","html_url":"https://github.com/Spoje-NET/php-abo-parser","commit_stats":null,"previous_names":["spoje-net/php-abo-parser"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Spoje-NET/php-abo-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spoje-NET%2Fphp-abo-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spoje-NET%2Fphp-abo-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spoje-NET%2Fphp-abo-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spoje-NET%2Fphp-abo-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Spoje-NET","download_url":"https://codeload.github.com/Spoje-NET/php-abo-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spoje-NET%2Fphp-abo-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273858876,"owners_count":25180772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-06T05:12:41.925Z","updated_at":"2025-10-27T00:10:22.221Z","avatar_url":"https://github.com/Spoje-NET.png","language":"PHP","readme":"# PHP ABO Parser\n\nA PHP library for parsing Czechoslovak ABO (Account Bank Operations) format files commonly used by Czech and Slovak banks for financial data exchange.\n\n[![PHP Version](https://img.shields.io/badge/PHP-8.4+-blue.svg)](https://www.php.net/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/Spoje-NET/php-abo-parser/ci.yml?branch=main)](https://github.com/Spoje-NET/php-abo-parser/actions)\n[![Coverage Status](https://img.shields.io/codecov/c/github/Spoje-NET/php-abo-parser?style=flat-square)](https://codecov.io/gh/Spoje-NET/php-abo-parser)\n[![PHPStan Level](https://img.shields.io/badge/PHPStan-Level%206-blueviolet.svg)](https://phpstan.org/)\n[![Downloads](https://img.shields.io/packagist/dt/spojenet/abo-parser.svg)](https://packagist.org/packages/spojenet/abo-parser)\n[![Last Commit](https://img.shields.io/github/last-commit/Spoje-NET/php-abo-parser.svg)](https://github.com/Spoje-NET/php-abo-parser/commits/main)\n\n## Features\n\n- **Dual Format Support**: Automatically detects and parses both basic and extended ABO formats\n- **Complete Record Parsing**: Handles account statements (074 records) and transaction records (075 records)\n- **Format Detection**: Automatically identifies which ABO format version is being used\n- **Extended Format Fields**: Supports additional fields in extended format (message fields, ISO currency info, SWIFT codes, etc.)\n- **Multiple Input Methods**: Read from files or stdin\n- **Flexible Output**: Output to JSON format with pretty printing\n- **Character Encoding Support**: Handles Czech/Slovak character encodings (Windows-1250, ISO-8859-2)\n- **Command Line Tool**: Ready-to-use CLI script for ABO to JSON conversion\n- **Type Safe**: Full PHP 8.4+ type hints and strict mode\n- **PSR-4 Autoloading**: Composer compatible\n\n## Installation\n\n### Via Composer\n\n```bash\ncomposer require spojenet/abo-parser\n```\n\n### Manual Installation\n\n```bash\ngit clone https://github.com/Spoje-NET/php-abo-parser.git\ncd php-abo-parser\ncomposer install\n```\n\n## Usage\n\n### Command Line Tool\n\nThe library includes a ready-to-use command line tool for converting ABO files to JSON:\n\n```bash\n# Show help\n./Example/abo2json.php --help\n\n# Convert ABO file to JSON (output to stdout)\n./Example/abo2json.php --abofile data.abo\n\n# Convert ABO file and save to JSON file\n./Example/abo2json.php --abofile data.abo --jsonfile output.json\n\n# Read from stdin and output to stdout\ncat data.abo | ./Example/abo2json.php\n\n# Read from stdin and save to file\ncat data.abo | ./Example/abo2json.php --jsonfile output.json\n```\n\n#### Simple Example Script\n\nFor a more detailed demonstration, use the included simple example:\n\n```bash\n# Run the simple example\n./Example/simple_example.php path/to/your/file.abo\n\n# Run and save JSON output\n./Example/simple_example.php path/to/your/file.abo output.json\n```\n\nThis script provides a human-readable summary of the parsed data.\n\n### PHP Library API\n\n#### Basic Usage\n\n```php\n\u003c?php\nrequire_once 'vendor/autoload.php';\n\nuse SpojeNet\\AboParser\\AboParser;\n\n// Parse from file\n$parser = new AboParser();\n$data = $parser-\u003eparseFile('path/to/file.abo');\n\n// Parse from string\n$aboContent = file_get_contents('path/to/file.abo');\n$data = $parser-\u003eparse($aboContent);\n\n// Access parsed data\necho \"Found \" . count($data['statements']) . \" account statements\\n\";\necho \"Found \" . count($data['transactions']) . \" transactions\\n\";\n\n// Convert to JSON\n$json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);\necho $json;\n```\n\n#### Advanced Usage\n\n```php\n\u003c?php\nuse SpojeNet\\AboParser\\AboParser;\n\n$parser = new AboParser();\n$data = $parser-\u003eparseFile('bank_statement.abo');\n\n// Process account statements (074 records)\nforeach ($data['statements'] as $statement) {\n    echo \"Account: \" . $statement['account_number'] . \"\\n\";\n    echo \"Account Name: \" . $statement['account_name'] . \"\\n\";\n    echo \"Old Balance: \" . $statement['old_balance'] . \"\\n\";\n    echo \"New Balance: \" . $statement['new_balance'] . \"\\n\";\n    echo \"Statement Date: \" . $statement['accounting_date'] . \"\\n\\n\";\n}\n\n// Process transactions (075 records)\nforeach ($data['transactions'] as $transaction) {\n    echo \"Transaction Amount: \" . $transaction['amount'] . \"\\n\";\n    echo \"Counter Account: \" . $transaction['counter_account'] . \"\\n\";\n    echo \"Variable Symbol: \" . $transaction['variable_symbol'] . \"\\n\";\n    echo \"Date: \" . $transaction['valuation_date'] . \"\\n\\n\";\n}\n\n// Access raw records for debugging\nforeach ($data['raw_records'] as $record) {\n    echo \"Line \" . $record['line'] . \" (Type: \" . $record['type'] . \"): \" . $record['content'] . \"\\n\";\n}\n```\n\n## Data Structure\n\nThe parser returns an array with three main sections:\n\n### Parsed Data Structure\n\n```php\n[\n    'format_version' =\u003e 'basic|extended',  // Detected ABO format version\n    'statements' =\u003e [...],                 // Parsed account statements (074 records)\n    'transactions' =\u003e [...],               // Parsed transactions (075 records)\n    'raw_records' =\u003e [...]                // Raw line data for debugging\n]\n```\n\n### Account Statement (074 Record)\n\n```php\n[\n    'record_type' =\u003e '074',\n    'account_number' =\u003e '0000000002122722',\n    'account_name' =\u003e 'Account Holder Name',\n    'old_balance_date' =\u003e '2025-08-20',\n    'old_balance' =\u003e 99474.70,\n    'old_balance_sign' =\u003e '+',\n    'new_balance' =\u003e 93201.15,\n    'new_balance_sign' =\u003e '+',\n    'debit_turnover' =\u003e 6273.55,\n    'debit_turnover_sign' =\u003e '+',\n    'credit_turnover' =\u003e 0.00,\n    'credit_turnover_sign' =\u003e '+',\n    'statement_number' =\u003e '027',\n    'accounting_date' =\u003e '2025-08-21',\n    'raw_line' =\u003e '074...'\n]\n```\n\n### Transaction (075 Record)\n\n#### Basic Format\n```php\n[\n    'record_type' =\u003e '075',\n    'format' =\u003e 'basic',\n    'account_number' =\u003e '0000000002122722',\n    'counter_account' =\u003e '0000000100785108',\n    'document_number' =\u003e '0001865283798',\n    'amount' =\u003e 110.00,\n    'accounting_code' =\u003e '1',\n    'variable_symbol' =\u003e '5174658167',\n    'constant_symbol' =\u003e '0003000308',\n    'specific_symbol' =\u003e '0000000000',\n    'valuation_date' =\u003e '2025-08-21',\n    'additional_info' =\u003e '',\n    'change_code' =\u003e '0',\n    'data_type' =\u003e '1101',\n    'due_date' =\u003e '2025-08-21',\n    'raw_line' =\u003e '075...'\n]\n```\n\n#### Extended Format (includes all basic fields plus:)\n```php\n[\n    // ... all basic fields ...\n    'format' =\u003e 'extended',\n    'message_for_recipient' =\u003e 'Payment description',\n    'message_for_recipient_2' =\u003e 'Additional info line 2',\n    'message_for_recipient_3' =\u003e 'Additional info line 3',\n    'message_for_recipient_4' =\u003e 'Additional info line 4',\n    'message_for_sender' =\u003e 'Internal note',\n    'debited_date' =\u003e '2025-08-21',\n    'item_description' =\u003e 'Transaction type',\n    'identification_reference' =\u003e 'REF123456789',\n    'amount_iso' =\u003e 110.00,\n    'currency_iso' =\u003e 'CZK',\n    'counter_account_name' =\u003e 'Recipient Bank Name',\n    // ... and many more extended fields\n]\n```\n\n## ABO Format Specification\n\nThe ABO format is a fixed-width text format used in Czech and Slovak banking systems. This library supports:\n\n- **074 Records**: Account statements with balance information\n- **075 Records**: Individual transaction records\n- **Character Encodings**: Windows-1250, ISO-8859-2, UTF-8\n- **Date Format**: ddmmrr (day-month-year, 2-digit year)\n- **Amount Format**: Integer values in haléře/cents (last 2 digits are decimal)\n\n### ABO Format Versions\n\nThere are two versions of the ABO format:\n\n#### Basic ABO Format\n- **075 Record Length**: ~128 characters\n- **Fields**: 15 fields with essential transaction information\n- **Usage**: Standard for most banking applications\n- **Fields Include**: Account numbers, amounts, symbols, dates, basic descriptions\n\n#### Extended ABO Format  \n- **075 Record Length**: 1700+ characters\n- **Fields**: 49 fields with comprehensive transaction details\n- **Usage**: Advanced banking systems requiring detailed transaction information\n- **Additional Fields Include**:\n  - Multiple message fields for recipients and senders\n  - ISO currency information and exchange rates\n  - SWIFT bank codes and international references\n  - SEPA payment information\n  - Detailed fee and charge information\n  - Multiple transaction description fields\n\n**Format Detection**: The parser automatically detects which format is being used by analyzing the length of 075 records. No manual configuration is required.\n\n## Requirements\n\n- **PHP**: 8.4 or higher\n- **Extensions**: mbstring (for character encoding conversion)\n- **Composer**: For autoloading (recommended)\n\n## Development\n\n### Running Tests\n\n```bash\n# Install dev dependencies\ncomposer install\n\n# Run tests\nvendor/bin/phpunit tests\n# OR\nmake tests\n```\n\n### Code Quality\n\n```bash\n# Static analysis\nvendor/bin/phpstan analyse --configuration=phpstan-default.neon.dist --memory-limit=-1\n# OR\nmake static-code-analysis\n\n# Code formatting\nvendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --verbose --allow-risky=yes\n# OR\nmake cs\n```\n\n### Available Make Commands\n\n```bash\n# Show all available commands\nmake help\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n### Coding Standards\n\n- PSR-12 coding standard\n- PHPStan level 6\n- All code comments and messages in English\n- Type hints for all function parameters and return types\n- Comprehensive PHPDoc blocks\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- **Issues**: [GitHub Issues](https://github.com/Spoje-NET/php-abo-parser/issues)\n- **Documentation**: This README and inline code documentation\n- **Examples**: See the `Example/` directory\n\n## Acknowledgments\n\n- Czech and Slovak banking institutions for ABO format specification\n- Contributors and maintainers\n\n\u003ca href=\"https://spojenet.cz\"\u003e\u003cimg width=\"200\" src=\"spojentetitlogo.svg\" alt=\"SpojeNetIT s.r.o.\" height=\"40\"\u003e\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspoje-net%2Fphp-abo-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspoje-net%2Fphp-abo-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspoje-net%2Fphp-abo-parser/lists"}