This tool converts Raiffeisen Bank Serbia XML statements (in TransakcioniRacunPrivredaPromet format) to Plain Text Accounting (PTA) format with automatic transaction categorization.
- 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
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 elementZaglavlje
contains statement metadata- Multiple
Stavke
elements represent individual transactions
- Ensure you have Python 3.6+ installed
- Install required dependencies:
pip install pyyaml
# Single or multiple files: specify input(s) and a single output PTA file
python app.py input1.xml [input2.xml ...] output.pta
# 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
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"
The generated PTA file includes:
- Header with statement metadata
- Currency declaration
- Account declarations
- Transactions in ledger format
This software is provided as-is under the MIT License.