Skip to content

A tool to convert Raiffeisenbank Serbia 'XML' account statements for small business to PTA ledger format.

Notifications You must be signed in to change notification settings

Ceesaxp/rbrs-xml-statements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serbian Bank Statement Converter

This tool converts Raiffeisen Bank Serbia XML statements (in TransakcioniRacunPrivredaPromet format) to Plain Text Accounting (PTA) format with automatic transaction categorization.

Features

  • Converts Raiffeisen Bank Serbia XML statements to PTA format
  • Automatically categorizes transactions based on payee and description
  • Customizable through configuration file
  • Provides detailed account declarations

Supported XML Format

The converter expects XML files with the following structure:

<TransakcioniRacunPrivredaPromet>
    <Zaglavlje Partija="..." KomitentNaziv="..." DatumOd="..." DatumDo="..." .../>
    <Stavke DatumValute="..." NalogKorisnik="..." Opis="..." Duguje="..." Potrazuje="..." .../>
    <Stavke .../>
    ...
</TransakcioniRacunPrivredaPromet>
  • TransakcioniRacunPrivredaPromet is the root element
  • Zaglavlje contains statement metadata
  • Multiple Stavke elements represent individual transactions

Installation

  1. Ensure you have Python 3.6+ installed
  2. Install required dependencies:
pip install pyyaml

Usage

Basic Usage

# Single or multiple files: specify input(s) and a single output PTA file
python app.py input1.xml [input2.xml ...] output.pta

Advanced Options

# Convert with custom configuration and verbose logging
python app.py input1.xml [input2.xml ...] output.pta --config custom_config.yml --verbose

Options:

  • --config or -c: Path to a custom configuration file
  • --verbose or -v: Enable verbose logging

Configuration

The converter uses a configuration file (config.yml) to customize its behavior. If this file doesn't exist, default settings are used.

You can create or modify the configuration file to:

  • Change default accounts
  • Add payee-to-account mappings
  • Define special rules for categorization

Example config.yml:

base_account_name: "Assets:Bank:RaiffeisenRS"
default_expenses_account: "Expenses:Unknown"
default_income_account: "Income:Unknown"
currency_symbol: "RSD"

payee_to_account_map:
  "some company": "Expenses:Services:SomeCategory"
  "another payee": "Income:Sales"

special_rules:
  bank_fees:
    payee: "raiffeisen banka"
    keyword: "provizija"
    account: "Expenses:Fees:Bank"

Output Format

The generated PTA file includes:

  • Header with statement metadata
  • Currency declaration
  • Account declarations
  • Transactions in ledger format

License

This software is provided as-is under the MIT License.

About

A tool to convert Raiffeisenbank Serbia 'XML' account statements for small business to PTA ledger format.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages