Import Mercury banking transactions into beancount format
Project description
beancount-v3-mercury
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.
'Expenses:Cloud-Services:Source-Hosting:Github': ['GITHUB'],
'Expenses:Postage:FedEx': ['Fedex'],
'Expenses:Supermarket': ['REWE', 'ALDI'],
}
),
]
if __name__ == '__main__':
Ingest(importers).cli()
The account_patterns parameter is a dictionary mapping account names to lists of regex patterns. 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. Accounts are checked in dictionary order, with earlier accounts taking priority over later accounts.
Once this configuration is in place, you can extract transactions from a Mercury CSV export:
python import.py extract mercury-transactions.csv
Beancount v2 Compatibility
Although this package is designed for Beancount v3, it is also compatible with Beancount v2 since it depends on beancount>=2.3.5 and uses beangulp as the importer framework, which supports both versions.
Resources
See awesome-beancount for other publicly available Beancount importers.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beancount_v3_mercury-1.0.0.tar.gz.
File metadata
- Download URL: beancount_v3_mercury-1.0.0.tar.gz
- Upload date:
- Size: 56.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20deaa211e8294c5098e30833796b6aa3ab41d4ce1ce366851d38687e60d1bc0
|
|
| MD5 |
3bff22e3be58348861c4db94469b6f96
|
|
| BLAKE2b-256 |
78021698bbad3134f9da200237927b602a3d9a38e1acc093e5973f57b9c65004
|
File details
Details for the file beancount_v3_mercury-1.0.0-py3-none-any.whl.
File metadata
- Download URL: beancount_v3_mercury-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b7d20eede3eecbd4b897a9d808b3b8af0c3d9bfe919399f88a985d22c4e7011
|
|
| MD5 |
daf66a6de30768a83c9a3765d8f5825a
|
|
| BLAKE2b-256 |
a1038271a81626733338624a3857b44297c33a18c57c08c52f877f7b758cdf4c
|