项目作者: CarliJoy

项目描述 :
Reader for PDF bank statements of GLS bank
高级语言: Python
项目地址: git://github.com/CarliJoy/GLS_account_statement_reader.git
创建时间: 2019-06-08T19:05:12Z
项目社区:https://github.com/CarliJoy/GLS_account_statement_reader

开源协议:MIT License

下载


Description

This script allows to read PDF bank statements from the GLS Bank.
Even so, the banks online manager supports exporting of CSV files, this works only for the past three month whereas PDF
account statements are kept for at least two years.

So if, you forced to automatically analyse past bank transactions, this script will help you.

The tool also supports reading the CSV files (which include more information), so you can analyse them.

I also tested it with Banking records from the Triodos Bank
and it works well. They both using the same banking system, so maybe also other
“Volksbank” or “Raiffeisenbank” work as well. Write me an issue

I tested it with the following Banking records so far:

  • GLS 2014-2020
  • Triodos 2020

Dependencies

  • python >= 3.6
  • pdftotext(part of poppler-utils)
  • jupyter-notebook [Optional]

Installation

Variant One

Install using pip install bank-statement-reader

Advantage:

  • Easy to install

Disadvantage:

  • some features like the booking/personal.py file depend on modifying the package
    the package source before installing, which won’t work using this
    method

Variant Two

Clone the repro locally, create and activate a new virtual environment
and run pip install -e . within the project folder.

Usage

After installation, you have a new command statement2csv available.

  1. usage: statement2csv [-h] [--out out.csv] statement.pdf [statement.pdf ...]
  2. Convert banking statements (PDF & CSV) to an analysed standard csv form.
  3. positional arguments:
  4. statement.pdf files to open and convert
  5. optional arguments:
  6. -h, --help show this help message and exit
  7. --out out.csv csv file to write the results to
  8. If no filename is given, the file will be saved to
  9. basename_first_file_%date_string%.csv.
  10. %date_string% will be always replaced to 'YYYY-mm-dd_to_YYYY-mm-dd'
  11. start date to end date

Another way to use the project is to use jupyter-notebook for fast analysing data.
See example.ipynb for an idea how to use it.

Data Protection Note

As bank statement data is highly sensitive, only very general rules for categorizing were pushed to this git.

Use src/bank_statement_reader/bookings/personal.py for customizations of categories and payees.
You only to create this file with a content like the following, and it will be used automatically.

  1. from bank_statement_reader.booking.booking_base import BookingBase
  2. class Booking(BookingBase):
  3. def _set_payee(self, value: str):
  4. """your custom functions here"""
  5. super()._set_payee(value)
  6. def _get_category(self):
  7. """your custom stuff here"""
  8. return super()._get_category()