Parse Grisbi .gsb files into typed domain objects and pandas DataFrames
Project description
gsbparse
A Python library for parsing Grisbi .gsb accounting files
into typed domain objects, with an optional pandas adapter for DataFrame output.
Documentation: gsbparse.readthedocs.io
Installation
pip install gsbparse
Or with uv:
uv add gsbparse
Requires Python 3.13+.
Quickstart
Read a file
import gsbparse
gsb = gsbparse.read_gsb("my_accounts.gsb")
Inspect typed sections
>>> gsb.currencies
[CurrencySection(Nb=1, Na='Euro', Co='€', Ico='EUR', Fl=2), CurrencySection(Nb=2, Na='US Dollar', Co='$', Ico='USD', Fl=2)]
>>> for account in gsb.accounts:
... print(account.Number, account.Name)
1 Checking
2 Savings
Detailed transactions (foreign keys resolved)
>>> tx = gsb.detailed_transactions[0]
>>> tx.Dt
datetime.date(2024, 1, 5)
>>> tx.Am
Decimal('-42.50')
>>> tx.Ac.Name
'Checking'
>>> tx.Pa.Na
'Supermarket'
Convert to pandas DataFrame
>>> import gsbparse.pandas as gsbpd
>>> gsbpd.to_df(gsb.currencies)
Nb Na Co Ico Fl
0 1 Euro € EUR 2
1 2 US Dollar $ USD 2
Custom column projection:
>>> from gsbparse import DetailedTransactionColumn
>>> columns = [
... DetailedTransactionColumn(path="Dt", output_name="date"),
... DetailedTransactionColumn(path="Am", output_name="amount"),
... DetailedTransactionColumn(path="Ac.Name", output_name="account"),
... DetailedTransactionColumn(path="Pa.Na", output_name="party"),
... DetailedTransactionColumn(path="Ca.Na", output_name="category"),
... ]
>>> gsbpd.to_df(gsb.detailed_transactions, columns=columns)
date amount account party category
0 2024-01-05 -42.50 Checking Supermarket Food
1 2024-01-31 2500.00 Checking Employer Income
See the full quickstart and API reference on Read the Docs.
Development
git clone https://github.com/etnbsd/gsbparse.git
cd gsbparse
uv sync --dev
pre-commit install
Common commands (via make):
| Command | What it does |
|---|---|
make test |
Run the test suite |
make lint |
Run ruff check |
make format |
Run ruff format |
make type-check |
Run mypy in strict mode |
make import-check |
Enforce hexagonal import boundaries |
make ci |
Run all of the above |
Contributing
- Fork the repo and create a short-lived branch.
- Follow Conventional Commits — enforced by pre-commit.
- Open a pull request against
main.
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 gsbparse-0.5.0.tar.gz.
File metadata
- Download URL: gsbparse-0.5.0.tar.gz
- Upload date:
- Size: 123.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c82749f51b2c386e467d0e43bd5b4c9882ec5356ef0b56467a0628211d82a2e
|
|
| MD5 |
e1a26a29ea3a2d800730e3cfe79d833f
|
|
| BLAKE2b-256 |
9bfdeb85113fb3d2bb70787492938ec8c594f20fcb121e96e83ba9de39027f3d
|
Provenance
The following attestation bundles were made for gsbparse-0.5.0.tar.gz:
Publisher:
publish.yml on EBoisseauSierra/gsbparse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsbparse-0.5.0.tar.gz -
Subject digest:
1c82749f51b2c386e467d0e43bd5b4c9882ec5356ef0b56467a0628211d82a2e - Sigstore transparency entry: 1281024822
- Sigstore integration time:
-
Permalink:
EBoisseauSierra/gsbparse@212a19230129bd45864f804325c5b43b3eb9cd3e -
Branch / Tag:
refs/tags/0.5.0 - Owner: https://github.com/EBoisseauSierra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@212a19230129bd45864f804325c5b43b3eb9cd3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file gsbparse-0.5.0-py3-none-any.whl.
File metadata
- Download URL: gsbparse-0.5.0-py3-none-any.whl
- Upload date:
- Size: 62.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
daabeed5503ae623e65d63a185c4e4c777032356b196d88413d48115ff98315f
|
|
| MD5 |
e59ba2a17ea6e6ced9dc0425f799ffe0
|
|
| BLAKE2b-256 |
d28e35ff9b5023a47345231c50fb20fe4cf4b0f569aab185fe19341ca0c070d4
|
Provenance
The following attestation bundles were made for gsbparse-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on EBoisseauSierra/gsbparse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsbparse-0.5.0-py3-none-any.whl -
Subject digest:
daabeed5503ae623e65d63a185c4e4c777032356b196d88413d48115ff98315f - Sigstore transparency entry: 1281024824
- Sigstore integration time:
-
Permalink:
EBoisseauSierra/gsbparse@212a19230129bd45864f804325c5b43b3eb9cd3e -
Branch / Tag:
refs/tags/0.5.0 - Owner: https://github.com/EBoisseauSierra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@212a19230129bd45864f804325c5b43b3eb9cd3e -
Trigger Event:
push
-
Statement type: