Metadata-Version: 2.4
Name: ubs-transactions-csv-parser
Version: 0.2.1
Summary: Parse and deduplicate UBS transaction CSV files.
Home-page: https://github.com/rito1998/ubs-transactions-csv-parser
Author: Riccardo Torreggiani
Author-email: Riccardo Torreggiani <riccardo.torreggiani@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Riccardo Torreggiani
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/rito1998/ubs-transactions-csv-parser
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pycountry>=23
Dynamic: license-file

# UBS Transactions CSV Parser

A Python package to parse and process transaction CSV files exported from UBS online banking.

## Usage

Install the package with your preferred method.

```bash
pip install ubs-transactions-csv-parser
```

Import the transactions from a CSV file.

```python
from ubs_transactions_csv_parser import AccountExportData
from pathlib import Path

# Parse a CSV file
csv_data = AccountExportData.from_csv(Path("transactions.csv"))

# Access the transactions
for transaction in csv_data.transactions:
    # ...
```

## UBS CSV Format

UBS exports transactions in a non-standard CSV format with two sections:

1. **Metadata section** - Account information and period details
2. **Transactions section** - Standard CSV with transaction data

Example format:

```csv
Account number:;1234 12345678.12;
IBAN:;CH20 0011 2233 4455 6677 B;
From:;2025-01-01;
Until:;2025-12-31;
Opening balance:;1234.12;
Closing balance:;12345.12;
Valued in:;CHF;
Numbers of transactions in this period:;365;

Trade date;Trade time;Booking date;Value date;Currency;Debit;Credit;Individual amount;Balance;Transaction no.;Description1;Description2;Description3;Footnotes;
2025-01-01;00:11:22;2025-01-01;2025-01-01;CHF;-137.00;;;1370.17;4825794DP1572581029;"John Doe";"Standing order";"Reference details";;
```

## Example jupyter notebook

Check out the [example Jupyter notebook](examples/ubs-transactions-csv-parser.ipynb) for data analysis and visualization examples. Below an example plot of transactions imported from multiple files.

![img](docs/assets/transactions-plot-example-notebook.png)

## License

This project is licensed under the MIT License. See the LICENSE file for details.
