An open API service indexing awesome lists of open source software.

https://github.com/andrewscwei/rbc-statement-parser

Handy Python script to parse RBC Visa statements
https://github.com/andrewscwei/rbc-statement-parser

parser rbc statement

Last synced: 16 days ago
JSON representation

Handy Python script to parse RBC Visa statements

Awesome Lists containing this project

README

          

# RBC Statement Parser

Python script for parsing RBC PDF statements, compatible with both VISA and personal banking accounts (i.e. chequing, savings, etc). The output is a list of formatted transactions printed on console or output to a file.

## Setup

Set up environment:

```sh
$ pre-commit install
$ pipenv install -d
$ pipenv shell
```

## Usage

Download PDF statements from RBC and save them in a directory.

```sh
# Parse PDF(s) and output to console
$ python main.py

# Parse PDF(s) and output to console and out.txt
$ python main.py -o out.txt
```

## Linting

```sh
$ pylint **/*.py
```

## Config

Create a `.rc` file in project root. You can also provide another file name and pass it to `--config` or `-c` option flag when executing `main.py`. See below example to understand what this config does:

```js
{
// String format of each transaction in the output, the following is the
// default.
"format": "{date}\t{method}\t{code}\t{description}\t{category}\t{amount}",

// Each key is a category name to be assigned to a parsed transaction, and
// each array element is a regex pattern where if the transaction description
// matches any of the patterns, the category association will be made.
"categories": {
"": [
"",
"",
"",
...
],
"": [
"",
"",
"",
...
],
...
},
// Each array element is a regex pattern where if the transaction description
// matches any of the patterns, it will be excluded from the output.
"excludes": [
"",
"",
"",
...
]
}
```