Skip to main content

Beancount/CSV parser for HK Bank Accounts

PyPI version fury.io

Few Hong Kong Banks provide structured formatted (CSVs, OFX, etc) electronic statements to users, usually only PDFs are available (unless you're a Business-tier user).

This package parses PDF eStatements from some of the HK Banks, and output results as beancount or CSV.

Currently supports:

  • Hang Seng Integrated Account (Only Savings transactions are extracted)
  • Hang Seng MPOWER Credit Card
  • DBS COMPASS VISA Credit Card

Installation

  1. Install external dependency pdftotext. This is normally packaged under poppler for most Linux distros. Windows users may try with this.

  2. Install package via pip:

     pip install beancount-hangseng
    

Usage

Beancount

  1. Add HangSengSavingsImporter/MPowerMasterImporter/DBSImporter to your import config (See config.py for example)
  2. Run bean-extract config.py /path/to/eStatement.pdf > output.beancount

CSV

beancount-hangseng-csv -o output.csv -f {hangseng,mpower,dbs} /path/to/statement.pdf

If statements are already downloaded in one folder, you may process and verify output in one go:

cd /path/to/output_dir
beancount-hangseng-csv -t {hangseng,mpower,dbs} -v /path/to/HangSeng_*.pdf -d /tmp/

Run beancount-hangseng-csv -h for more options and debug suggestions.

Credits

Inspired by @dictcp's Gist.


"Therefore I say unto you, Take no thought for your life, what ye shall eat, or what ye shall drink; nor yet for your body, what ye shall put on. Is not the life more than meat, and the body than raiment?" -- Matthew 6:25

Metadata

Release files for beancount-hangseng 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beancount-hangseng 0.4.0
File Size Uploaded
beancount-hangseng-0.4.0.tar.gz 9.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for beancount-hangseng 0.4.0
File Interpreter ABI Platform
beancount_hangseng-0.4.0-py3.7.egg Legacy Egg format - - Details
beancount_hangseng-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.1 kB

Release files / beancount-hangseng-0.4.0.tar.gz

Download URL beancount-hangseng-0.4.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c57bb87070775b1283be28087ba85a69ce2f1e9d7662be9bdd72872301fb4fb8
BLAKE2b-256 checksum
How to use checksums
ba6220f1eeea4f18b5ac0117c9636ba39e651288fd6857ae844ef642d0fb0929
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / beancount_hangseng-0.4.0-py3.7.egg

Download URL beancount_hangseng-0.4.0-py3.7.egg
Size 12.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
0baa8cd62664667a04cf044341df3cfdfd34908b659251a5323a06f987ed6054
BLAKE2b-256 checksum
How to use checksums
0f75745f613e2a24e3d87a4de3d1f64fdd90886edd73f26df799ec05baf62b59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release files / beancount_hangseng-0.4.0-py3-none-any.whl

Download URL beancount_hangseng-0.4.0-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a95c848b63ebaed4e2d3f70f4f68d6ecd7ae671cbef4bc83c23d043941d1b3e3
BLAKE2b-256 checksum
How to use checksums
fcb76ab7c20f30d6171a86309f87fe82ddf9487e47d9411f7b0d29555e0671be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.4.0 This release

3 release files

0.3.0

3 release files

0.2.1

3 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page