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
- Host: GitHub
- URL: https://github.com/andrewscwei/rbc-statement-parser
- Owner: andrewscwei
- License: mit
- Created: 2018-07-09T23:23:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-17T17:11:16.000Z (about 1 year ago)
- Last Synced: 2024-10-20T01:41:40.909Z (about 1 year ago)
- Topics: parser, rbc, statement
- Language: Python
- Size: 123 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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": [
"",
"",
"",
...
]
}
```