Skip to main content

Import Mercury banking transactions into beancount format

Project description

beancount-v3-mercury

CI PyPI License

beancount-v3-mercury provides an Importer for converting CSV exports of Mercury checking transactions into Beancount format.

Installation

pip install beancount-v3-mercury
# or
uv add beancount-v3-mercury

Usage

Create an import script (e.g. import.py) as follows:

import beancount_mercury
from beangulp import Ingest

importers = [
    beancount_mercury.CheckingImporter(
        'Assets:Checking:Mercury',
        currency='USD',
        account_patterns=[
          # These are example patterns. You can add your own.
          ('GITHUB', 'Expenses:Cloud-Services:Source-Hosting:Github'),
          ('Fedex',  'Expenses:Postage:FedEx'),
        ]
    ),
]

if __name__ == '__main__':
    Ingest(importers).cli()

The account_patterns parameter is a list of (regex, account) pairs. For each line in your Mercury CSV, CheckingImporter will attempt to create a matching posting on the transaction by matching the payee or narration to the regexes. The regexes are in priority order, with earlier patterns taking priority over later patterns.

Once this configuration is in place, you can extract transactions from a Mercury CSV export:

python import.py extract mercury-transactions.csv

Resources

See awesome-beancount for other publicly available Beancount importers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beancount_v3_mercury-0.2.0.tar.gz (56.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beancount_v3_mercury-0.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file beancount_v3_mercury-0.2.0.tar.gz.

File metadata

File hashes

Hashes for beancount_v3_mercury-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a23485597fcf94eb5d4d610604d48bddf0d3da159c8c4cedb455ef655695f26e
MD5 c0d22d6eb9faeade32651879b57e0d11
BLAKE2b-256 2b0037581091d89c4da0241a4dc63416ec320be25e2f541c4a16e550284eb86a

See more details on using hashes here.

File details

Details for the file beancount_v3_mercury-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for beancount_v3_mercury-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63b73719bd01f9183ae3a41988ee943139eedc7b849b462f26164f334e9604fc
MD5 d2755cf280797092bd86c2acb273dc37
BLAKE2b-256 47f188f77c2a9f90fd5b4b889ed9a86c4c09ac6d1a9158f5827dd007999ada8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page