Skip to content

Commit

Permalink
add support for Beancount v3
Browse files Browse the repository at this point in the history
This uses beanquery to replace the functionality in beancount.query,
which works with both Beancount v2 and v3 - however there are some
differences on columns in beanquery compared to beancount.query.

For importers, this sticks to beancount.ingest on v2 and used beangulp
for v3. It still expectes importers to conform to the v2 importer
protocol for now. Due to changes related to duplicate detection,
duplicate detection is not automatically done by Fava here but can still
be manually specified as hooks.
  • Loading branch information
yagebu committed Sep 15, 2024
1 parent c0cd1f1 commit 3c7495f
Show file tree
Hide file tree
Showing 38 changed files with 791 additions and 664 deletions.
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

Unreleased
----------

Support for Beancount version 3 was added. Using Beancount 2 is still
supported. Beancount query support is now provided by the beanquery package,
which has some minor differences in syntax, the provided columns and functions
to the bean-query functionality in Beancount version 2.

v1.28 (2024-07-07)
------------------

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ run-example:
.PHONY: bql-grammar
bql-grammar:
tox exec -e lint -- python contrib/scripts.py generate-bql-grammar-json
-pre-commit run -a prettier

# Build the distribution (sdist and wheel).
.PHONY: dist
Expand Down
104 changes: 29 additions & 75 deletions constraints-old.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,36 @@ babel==2.7.0
# via
# fava (pyproject.toml)
# flask-babel
beancount==2.3.6
beancount==3.0.0
# via
# fava (pyproject.toml)
# beangulp
# beanquery
beangulp==0.1.0
# via fava (pyproject.toml)
beautifulsoup4==4.12.3
# via beancount
bottle==0.12.25
# via beancount
cachetools==5.3.2
# via google-auth
certifi==2024.2.2
# via requests
chardet==5.2.0
# via beancount
charset-normalizer==3.3.2
# via requests
beanquery==0.1.dev0
# via fava (pyproject.toml)
beautifulsoup4==4.0.1
# via beangulp
chardet==1.0
# via beangulp
cheroot==8.0.0
# via fava (pyproject.toml)
click==8.0.0
click==8.0.1
# via
# fava (pyproject.toml)
# beancount
# beangulp
# beanquery
# flask
flask==2.2.0
# via
# fava (pyproject.toml)
# flask-babel
flask-babel==1.0.0
# via fava (pyproject.toml)
google-api-core==2.17.1
# via google-api-python-client
google-api-python-client==2.119.0
# via beancount
google-auth==2.28.1
# via
# google-api-core
# google-api-python-client
# google-auth-httplib2
google-auth-httplib2==0.2.0
# via google-api-python-client
googleapis-common-protos==1.62.0
# via google-api-core
httplib2==0.22.0
# via
# google-api-python-client
# google-auth-httplib2
idna==3.6
# via
# anyio
# requests
iniconfig==2.0.0
# via pytest
# via anyio
itsdangerous==2.1.2
# via flask
jaraco-functools==4.0.0
Expand All @@ -65,7 +46,9 @@ jinja2==3.0.0
# flask
# flask-babel
lxml==5.1.0
# via beancount
# via
# fava (pyproject.toml)
# beangulp
markdown2==2.3.0
# via fava (pyproject.toml)
markupsafe==2.1.5
Expand All @@ -76,59 +59,30 @@ more-itertools==10.2.0
# via
# cheroot
# jaraco-functools
packaging==23.2
# via pytest
pdfminer2==20151206
# via beancount
pluggy==1.4.0
# via pytest
ply==3.4
# via fava (pyproject.toml)
python-dateutil==2.8.2
# via
# fava (pyproject.toml)
# beancount
protobuf==4.25.3
# via
# google-api-core
# googleapis-common-protos
pyasn1==0.5.1
# via
# pyasn1-modules
# rsa
pyasn1-modules==0.3.0
# via google-auth
pyparsing==3.1.1
# via httplib2
pytest==8.0.1
# via beancount
python-dateutil==2.8.2
# via beancount
python-magic==0.4.27
# via beancount
# beanquery
python-magic==0.4.12
# via beangulp
pytz==2024.1
# via
# babel
# flask-babel
requests==2.31.0
# via
# beancount
# google-api-core
rsa==4.9
# via google-auth
regex==2022.9.13
# via beancount
simplejson==3.16.0
# via fava (pyproject.toml)
six==1.16.0
# via
# cheroot
# pdfminer2
# python-dateutil
sniffio==1.1.0
# via anyio
soupsieve==2.5
# via beautifulsoup4
uritemplate==4.1.1
# via google-api-python-client
urllib3==2.2.1
# via requests
tatsu==5.7.4
# via beanquery
watchfiles==0.20.0
# via fava (pyproject.toml)
werkzeug==2.2.0
Expand Down
85 changes: 27 additions & 58 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,25 @@ babel==2.16.0
# fava (pyproject.toml)
# flask-babel
# sphinx
beancount==2.3.6
beancount==3.0.0
# via
# fava (pyproject.toml)
# beangulp
# beanquery
beangulp==0.1.1
# via fava (pyproject.toml)
beanquery==0.1.dev0
# via fava (pyproject.toml)
beautifulsoup4==4.12.3
# via
# beancount
# beangulp
# furo
blinker==1.8.2
# via flask
bottle==0.13.1
# via beancount
build==1.2.2
# via fava (pyproject.toml)
cachetools==5.5.0
# via
# google-auth
# tox
# via tox
certifi==2024.8.30
# via requests
cffi==1.17.1
Expand All @@ -37,7 +40,7 @@ cfgv==3.4.0
# via pre-commit
chardet==5.2.0
# via
# beancount
# beangulp
# pyexcel
# tox
charset-normalizer==3.3.2
Expand All @@ -47,6 +50,9 @@ cheroot==10.0.1
click==8.1.7
# via
# fava (pyproject.toml)
# beancount
# beangulp
# beanquery
# flask
colorama==0.4.6
# via tox
Expand Down Expand Up @@ -76,23 +82,6 @@ flask-babel==4.0.0
# via fava (pyproject.toml)
furo==2024.8.6
# via fava (pyproject.toml)
google-api-core==2.19.2
# via google-api-python-client
google-api-python-client==2.145.0
# via beancount
google-auth==2.34.0
# via
# google-api-core
# google-api-python-client
# google-auth-httplib2
google-auth-httplib2==0.2.0
# via google-api-python-client
googleapis-common-protos==1.65.0
# via google-api-core
httplib2==0.22.0
# via
# google-api-python-client
# google-auth-httplib2
identify==2.6.1
# via pre-commit
idna==3.9
Expand Down Expand Up @@ -135,7 +124,8 @@ lml==0.1.0
# pyexcel-io
lxml==5.3.0
# via
# beancount
# fava (pyproject.toml)
# beangulp
# pyexcel-ezodf
# pyexcel-ods3
markdown-it-py==3.0.0
Expand Down Expand Up @@ -175,8 +165,6 @@ packaging==24.1
# sphinx
# tox
# tox-uv
pdfminer2==20151206
# via beancount
pkginfo==1.10.0
# via twine
platformdirs==4.3.3
Expand All @@ -189,24 +177,9 @@ pluggy==1.5.0
# pytest
# tox
ply==3.11
# via
# fava (pyproject.toml)
# beancount
# via fava (pyproject.toml)
pre-commit==3.8.0
# via fava (pyproject.toml)
proto-plus==1.24.0
# via google-api-core
protobuf==5.28.1
# via
# google-api-core
# googleapis-common-protos
# proto-plus
pyasn1==0.6.1
# via
# pyasn1-modules
# rsa
pyasn1-modules==0.4.1
# via google-auth
pycparser==2.22
# via cffi
pyexcel==0.7.0
Expand Down Expand Up @@ -234,33 +207,33 @@ pyinstaller-hooks-contrib==2024.8
# via pyinstaller
pylint==3.2.7
# via fava (pyproject.toml)
pyparsing==3.1.4
# via httplib2
pyproject-api==1.7.1
# via tox
pyproject-hooks==1.1.0
# via build
pytest==8.3.3
# via
# fava (pyproject.toml)
# beancount
# pytest-cov
pytest-cov==5.0.0
# via fava (pyproject.toml)
python-dateutil==2.9.0.post0
# via beancount
# via
# beancount
# beanquery
python-magic==0.4.27
# via beancount
# via beangulp
pytz==2024.2
# via flask-babel
pyyaml==6.0.2
# via pre-commit
readme-renderer==44.0
# via twine
regex==2024.9.11
# via beancount
requests==2.32.3
# via
# beancount
# google-api-core
# fava (pyproject.toml)
# requests-toolbelt
# sphinx
# twine
Expand All @@ -270,8 +243,6 @@ rfc3986==2.0.0
# via twine
rich==13.8.1
# via twine
rsa==4.9
# via google-auth
secretstorage==3.3.3
# via keyring
setuptools==74.1.2
Expand All @@ -282,9 +253,7 @@ setuptools==74.1.2
simplejson==3.19.3
# via fava (pyproject.toml)
six==1.16.0
# via
# pdfminer2
# python-dateutil
# via python-dateutil
sniffio==1.3.1
# via anyio
snowballstemmer==2.2.0
Expand Down Expand Up @@ -313,6 +282,8 @@ sphinxcontrib-qthelp==2.0.0
# via sphinx
sphinxcontrib-serializinghtml==2.0.0
# via sphinx
tatsu==5.7.4
# via beanquery
texttable==1.7.0
# via pyexcel
tomlkit==0.13.2
Expand All @@ -331,8 +302,6 @@ types-simplejson==3.19.0.20240801
# via fava (pyproject.toml)
typing-extensions==4.12.2
# via mypy
uritemplate==4.1.1
# via google-api-python-client
urllib3==2.2.3
# via
# requests
Expand Down
Loading

0 comments on commit 3c7495f

Please sign in to comment.