beanhub-cli 1.4.0__tar.gz → 1.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/PKG-INFO +5 -68
- beanhub_cli-1.4.2/README.md +26 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/cli.py +3 -1
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/format.py +113 -1
- beanhub_cli-1.4.2/beanhub_cli/forms/app/static/js/beanhub-web-react-0.3.0.js +3 -0
- beanhub_cli-1.4.2/beanhub_cli/forms/app/static/js/beanhub-web-react-0.3.0.js.LICENSE.txt +50 -0
- beanhub_cli-1.4.2/beanhub_cli/forms/app/static/js/beanhub-web-react-0.3.0.js.map +1 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/templates/form.html +1 -1
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/pyproject.toml +3 -1
- beanhub_cli-1.4.0/README.md +0 -90
- beanhub_cli-1.4.0/beanhub_cli/forms/app/static/js/beanhub-web-react-0.1.6.js +0 -3
- beanhub_cli-1.4.0/beanhub_cli/forms/app/static/js/beanhub-web-react-0.1.6.js.map +0 -1
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/LICENSE +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/__init__.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/aliase.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/environment.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/__init__.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/__init__.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/constants.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/data/sample_forms_doc.yaml +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/deps.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/helpers.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/main.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/routes.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/settings.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/LICENSE +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/css/bootstrap-datepicker.css +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/css/bootstrap-datepicker.css.map +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/css/bootstrap-datepicker.min.css +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/js/bootstrap-datepicker.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker-en-CA.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ar-DZ.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ar-tn.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ar.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.az.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.bg.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.bm.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.bn.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.br.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.bs.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ca.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.cs.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.cy.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.da.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.de.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.el.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.en-AU.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.en-CA.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.en-GB.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.en-IE.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.en-NZ.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.en-US.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.en-ZA.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.eo.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.es.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.et.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.eu.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.fa.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.fi.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.fo.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.fr-CH.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.fr.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.gl.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.he.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.hi.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.hr.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.hu.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.hy.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.id.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.is.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.it-CH.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.it.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ja.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ka.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.kh.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.kk.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.km.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ko.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.kr.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.lt.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.lv.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.me.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.mk.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.mn.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.mr.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ms.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.nl-BE.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.nl.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.no.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.oc.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.pl.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.pt-BR.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.pt.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ro.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.rs-latin.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.rs.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ru.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.si.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.sk.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.sl.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.sq.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.sr-latin.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.sr.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.sv.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.sw.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.ta.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.tg.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.th.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.tk.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.tr.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.uk.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.uz-cyrl.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.uz-latn.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.vi.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-TW.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/LICENSE.txt +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/css/all.min.css +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/webfonts/fa-brands-400.ttf +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/webfonts/fa-brands-400.woff2 +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/webfonts/fa-regular-400.ttf +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/webfonts/fa-regular-400.woff2 +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/webfonts/fa-solid-900.ttf +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/webfonts/fa-solid-900.woff2 +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/webfonts/fa-v4compatibility.ttf +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/fontawesome6/webfonts/fa-v4compatibility.woff2 +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/LICENSE.md +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/css/select2.css +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/css/select2.min.css +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/af.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ar.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/az.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/bg.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/bn.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/bs.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ca.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/cs.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/da.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/de.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/dsb.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/el.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/en.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/eo.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/es.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/et.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/eu.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/fa.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/fi.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/fr.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/gl.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/he.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/hi.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/hr.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/hsb.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/hu.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/hy.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/id.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/is.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/it.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ja.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ka.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/km.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ko.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/lt.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/lv.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/mk.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ms.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/nb.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ne.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/nl.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/pa.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/pl.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ps.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/pt-BR.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/pt.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ro.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/ru.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/sk.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/sl.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/sq.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/sr-Cyrl.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/sr.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/sv.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/te.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/th.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/tk.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/tr.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/uk.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/vi.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/zh-CN.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/i18n/zh-TW.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/select2.full.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/select2.full.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/select2.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/static/vendor/select2/js/select2.min.js +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/templates/errors.html +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/templates/flash_messages.html +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/templates/footer.html +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/templates/home.html +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/app/templates/layout.html +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/cli.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/main.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/forms/validator.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/import_cli.py +0 -0
- {beanhub_cli-1.4.0 → beanhub_cli-1.4.2}/beanhub_cli/main.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: beanhub-cli
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.2
|
|
4
4
|
Summary: Command line tools for BeanHub
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Fang-Pen Lin
|
|
@@ -25,17 +25,20 @@ Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
|
25
25
|
Requires-Dist: rich (>=13.6.0,<14.0.0)
|
|
26
26
|
Requires-Dist: starlette-wtf (>=0.4.3,<0.5.0)
|
|
27
27
|
Requires-Dist: uvicorn (>=0.23.2,<1.0.0)
|
|
28
|
+
Project-URL: Documentation, https://beanhub-cli-docs.beanhub.io
|
|
28
29
|
Description-Content-Type: text/markdown
|
|
29
30
|
|
|
30
31
|
# beanhub-cli [](https://dl.circleci.com/status-badge/redirect/gh/LaunchPlatform/beanhub-cli/tree/master)
|
|
31
32
|
Command line tools for BeanHub or Beancount users.
|
|
32
33
|
|
|
34
|
+
Please read the [documentation here](https://beanhub-cli-docs.beanhub.io).
|
|
35
|
+
|
|
33
36
|
## Features
|
|
34
37
|
|
|
35
38
|
- **Local BeanHub Form web app** - You can run a [BeanHub Form](https://beanhub.io/blog/2023/07/31/automating-beancount-data-input-with-beanhub-custom-forms/) web app locally to try out your forms
|
|
36
39
|
- **Import** - Simple yet powerful [beanhub-import](https://github.com/LaunchPlatform/beanhub-import) allows you to define importing rules in YAML to extract transactions from CSV files and generate Beancount transactions automatically
|
|
37
40
|
- **Formatter** - Advanced Beancount file formatter based on top of [beancount-black](https://github.com/LaunchPlatform/beancount-black)
|
|
38
|
-
- **Basic Beancount file manipulations** - Effortless Beancount account name renaming and other basic manipulations
|
|
41
|
+
- **Basic Beancount file manipulations** - Effortless Beancount account name renaming and other basic manipulations
|
|
39
42
|
- **Doesn't require a BeanHub account** - While some features in the future will require a BeanHub repository to operate, but we make most of them usable even without a BeanHub account
|
|
40
43
|
|
|
41
44
|
## Screenshots
|
|
@@ -52,69 +55,3 @@ Command line tools for BeanHub or Beancount users.
|
|
|
52
55
|
|
|
53
56
|
A modern accounting book service based on the most popular open source version control system [Git](https://git-scm.com/) and text-based double entry accounting book software [Beancount](https://beancount.github.io/docs/index.html).
|
|
54
57
|
|
|
55
|
-
## Install
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
pip install beanhub-cli
|
|
59
|
-
```
|
|
60
|
-
## Usage
|
|
61
|
-
|
|
62
|
-
## BeanHub Import
|
|
63
|
-
|
|
64
|
-
To run BeanHub's import feature locally, you can define your import rules at `.beanhub/imports.yaml` and then run the following command in your Beancount folder:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
bh import
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
To learn more about the import document and how the BeanHub import feature works, you can read the README of [beanhub-import](https://github.com/LaunchPlatform/beanhub-import).
|
|
71
|
-
|
|
72
|
-
### BeanHub Forms web app
|
|
73
|
-
|
|
74
|
-
To make it much easier for BeanHub users to test their BeanHub Forms locally, we added a simple local web app for that in beanhub-cli.
|
|
75
|
-
You can run it by
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
bh form server
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
It should open the BeanHub Forms web page locally at http://localhost:8080 by default.
|
|
82
|
-
It reads the `.beanhub/forms.yaml` file from the current directory and will modify beancount files in the directory, so make sure you cd to your beancount directory before running the command.
|
|
83
|
-
To learn more about BeanHub Forms, please read our blog post [Automating Beancount data input with custom forms makes your life 10 times easier!](https://beanhub.io/blog/2023/07/31/automating-beancount-data-input-with-beanhub-custom-forms/).
|
|
84
|
-
|
|
85
|
-
### List BeanHub Forms
|
|
86
|
-
|
|
87
|
-
To list BeanHub Forms, simply run
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
bh form list
|
|
91
|
-
```
|
|
92
|
-
### Validate BeanHub Forms doc
|
|
93
|
-
|
|
94
|
-
To validate BeanHub Forms doc, simply run
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
bh form validate
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Format beancount files
|
|
101
|
-
|
|
102
|
-
You can run [beancount-black](https://github.com/LaunchPlatform/beancount-black) formatter against given files by the following command
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
bh format main.bean
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Without the file arguments, the format command will try to format `main.bean` in the current folder, and it will recursively follow all the `include` statements to format all the bean files.
|
|
109
|
-
Like this:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
bh format
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### More features to come
|
|
116
|
-
|
|
117
|
-
We are working on basic beancount file manipulation features, such as renaming account names.
|
|
118
|
-
We will also add new features only for BeanHub users as well.
|
|
119
|
-
But in general, if possible, we would like to make the features added to beancount-cli work locally without a BeanHub account as much as possible so that the beancount community can benefit from it.
|
|
120
|
-
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# beanhub-cli [](https://dl.circleci.com/status-badge/redirect/gh/LaunchPlatform/beanhub-cli/tree/master)
|
|
2
|
+
Command line tools for BeanHub or Beancount users.
|
|
3
|
+
|
|
4
|
+
Please read the [documentation here](https://beanhub-cli-docs.beanhub.io).
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
|
|
8
|
+
- **Local BeanHub Form web app** - You can run a [BeanHub Form](https://beanhub.io/blog/2023/07/31/automating-beancount-data-input-with-beanhub-custom-forms/) web app locally to try out your forms
|
|
9
|
+
- **Import** - Simple yet powerful [beanhub-import](https://github.com/LaunchPlatform/beanhub-import) allows you to define importing rules in YAML to extract transactions from CSV files and generate Beancount transactions automatically
|
|
10
|
+
- **Formatter** - Advanced Beancount file formatter based on top of [beancount-black](https://github.com/LaunchPlatform/beancount-black)
|
|
11
|
+
- **Basic Beancount file manipulations** - Effortless Beancount account name renaming and other basic manipulations
|
|
12
|
+
- **Doesn't require a BeanHub account** - While some features in the future will require a BeanHub repository to operate, but we make most of them usable even without a BeanHub account
|
|
13
|
+
|
|
14
|
+
## Screenshots
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://github.com/LaunchPlatform/beanhub-cli/raw/master/assets/forms-screenshot.png?raw=true" alt="BeanHub Forms Screenshot" />
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
# Sponsor
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="https://beanhub.io"><img src="https://github.com/LaunchPlatform/beanhub-cli/raw/master/assets/beanhub.svg?raw=true" alt="BeanHub logo" /></a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
A modern accounting book service based on the most popular open source version control system [Git](https://git-scm.com/) and text-based double entry accounting book software [Beancount](https://beancount.github.io/docs/index.html).
|
|
@@ -2,6 +2,7 @@ import logging
|
|
|
2
2
|
import os
|
|
3
3
|
|
|
4
4
|
import click
|
|
5
|
+
from rich.logging import Console
|
|
5
6
|
from rich.logging import RichHandler
|
|
6
7
|
|
|
7
8
|
from .aliase import AliasedGroup
|
|
@@ -25,10 +26,11 @@ from .environment import pass_env
|
|
|
25
26
|
def cli(env: Environment, log_level: str):
|
|
26
27
|
env.log_level = LogLevel(log_level)
|
|
27
28
|
FORMAT = "%(message)s"
|
|
29
|
+
console = Console(stderr=True)
|
|
28
30
|
logging.basicConfig(
|
|
29
31
|
level=LOG_LEVEL_MAP[env.log_level],
|
|
30
32
|
format=FORMAT,
|
|
31
33
|
datefmt="[%X]",
|
|
32
|
-
handlers=[RichHandler()],
|
|
34
|
+
handlers=[RichHandler(console=console)],
|
|
33
35
|
force=True,
|
|
34
36
|
)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import copy
|
|
2
|
+
import functools
|
|
1
3
|
import pathlib
|
|
2
4
|
import shutil
|
|
3
5
|
import sys
|
|
@@ -9,12 +11,15 @@ from beancount_black.formatter import Formatter
|
|
|
9
11
|
from beancount_parser.parser import make_parser
|
|
10
12
|
from beancount_parser.parser import traverse
|
|
11
13
|
from lark import Lark
|
|
14
|
+
from lark import Token
|
|
12
15
|
from lark import Tree
|
|
13
16
|
|
|
14
17
|
from .cli import cli
|
|
15
18
|
from .environment import Environment
|
|
16
19
|
from .environment import pass_env
|
|
17
20
|
|
|
21
|
+
TreeOrToken = Token | Tree
|
|
22
|
+
|
|
18
23
|
|
|
19
24
|
def create_backup(src: pathlib.Path, suffix: str) -> pathlib.Path:
|
|
20
25
|
"""Create a backup file
|
|
@@ -45,11 +50,92 @@ def file_tree_iterator(
|
|
|
45
50
|
yield filename, tree
|
|
46
51
|
|
|
47
52
|
|
|
53
|
+
def walk_tree(
|
|
54
|
+
tree_or_token: TreeOrToken,
|
|
55
|
+
processor: typing.Callable[[TreeOrToken], TreeOrToken | None],
|
|
56
|
+
):
|
|
57
|
+
result = processor(tree_or_token)
|
|
58
|
+
if result is not None:
|
|
59
|
+
# processor returned, let's use it instead
|
|
60
|
+
return result
|
|
61
|
+
if isinstance(tree_or_token, Tree):
|
|
62
|
+
return Tree(
|
|
63
|
+
data=tree_or_token.data,
|
|
64
|
+
children=list(
|
|
65
|
+
map(
|
|
66
|
+
functools.partial(walk_tree, processor=processor),
|
|
67
|
+
tree_or_token.children,
|
|
68
|
+
)
|
|
69
|
+
),
|
|
70
|
+
meta=tree_or_token.meta,
|
|
71
|
+
)
|
|
72
|
+
return copy.deepcopy(tree_or_token)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def rename_account_transform(
|
|
76
|
+
replacements: dict[str, str], tree_or_token: TreeOrToken
|
|
77
|
+
) -> TreeOrToken | None:
|
|
78
|
+
if not isinstance(tree_or_token, Token):
|
|
79
|
+
return
|
|
80
|
+
if tree_or_token.type != "ACCOUNT":
|
|
81
|
+
return
|
|
82
|
+
if tree_or_token.value not in replacements:
|
|
83
|
+
return
|
|
84
|
+
new_token = copy.deepcopy(tree_or_token)
|
|
85
|
+
new_token.value = replacements[tree_or_token.value]
|
|
86
|
+
return new_token
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def rename_commodity_transform(
|
|
90
|
+
replacements: dict[str, str], tree_or_token: TreeOrToken
|
|
91
|
+
) -> TreeOrToken | None:
|
|
92
|
+
if not isinstance(tree_or_token, Token):
|
|
93
|
+
return
|
|
94
|
+
if tree_or_token.type != "CURRENCY":
|
|
95
|
+
return
|
|
96
|
+
if tree_or_token.value not in replacements:
|
|
97
|
+
return
|
|
98
|
+
new_token = copy.deepcopy(tree_or_token)
|
|
99
|
+
new_token.value = replacements[tree_or_token.value]
|
|
100
|
+
return new_token
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def combine_transforms(
|
|
104
|
+
funcs: list[typing.Callable], tree_or_token: TreeOrToken
|
|
105
|
+
) -> TreeOrToken | None:
|
|
106
|
+
transformed = False
|
|
107
|
+
for func in funcs:
|
|
108
|
+
result = func(tree_or_token)
|
|
109
|
+
if result is None:
|
|
110
|
+
continue
|
|
111
|
+
transformed = True
|
|
112
|
+
tree_or_token = result
|
|
113
|
+
if not transformed:
|
|
114
|
+
return
|
|
115
|
+
return tree_or_token
|
|
116
|
+
|
|
117
|
+
|
|
48
118
|
@cli.command(name="format", help="Format Beancount files with beancount-black")
|
|
49
119
|
@click.argument("filename", type=click.Path(exists=False, dir_okay=False), nargs=-1)
|
|
50
120
|
@click.option(
|
|
51
121
|
"--backup-suffix", type=str, default=".backup", help="suffix of backup file"
|
|
52
122
|
)
|
|
123
|
+
@click.option(
|
|
124
|
+
"-ra",
|
|
125
|
+
"--rename-account",
|
|
126
|
+
type=(str, str),
|
|
127
|
+
help="rename account names",
|
|
128
|
+
nargs=2,
|
|
129
|
+
multiple=True,
|
|
130
|
+
)
|
|
131
|
+
@click.option(
|
|
132
|
+
"-rc",
|
|
133
|
+
"--rename-currency",
|
|
134
|
+
type=(str, str),
|
|
135
|
+
help="rename currency names",
|
|
136
|
+
nargs=2,
|
|
137
|
+
multiple=True,
|
|
138
|
+
)
|
|
53
139
|
@click.option(
|
|
54
140
|
"-s",
|
|
55
141
|
"--stdin-mode",
|
|
@@ -60,11 +146,27 @@ def file_tree_iterator(
|
|
|
60
146
|
@pass_env
|
|
61
147
|
def main(
|
|
62
148
|
env: Environment,
|
|
63
|
-
filename:
|
|
149
|
+
filename: list[click.Path],
|
|
64
150
|
backup_suffix: str,
|
|
151
|
+
rename_account: list[tuple[str, str]],
|
|
152
|
+
rename_currency: list[tuple[str, str]],
|
|
65
153
|
stdin_mode: bool,
|
|
66
154
|
backup: bool,
|
|
67
155
|
):
|
|
156
|
+
tree_transformers: list[typing.Callable] = []
|
|
157
|
+
if rename_account:
|
|
158
|
+
for from_val, to_val in rename_account:
|
|
159
|
+
env.logger.info("Renaming account from %s to %s", from_val, to_val)
|
|
160
|
+
tree_transformers.append(
|
|
161
|
+
functools.partial(rename_account_transform, dict(rename_account))
|
|
162
|
+
)
|
|
163
|
+
if rename_currency:
|
|
164
|
+
for from_val, to_val in rename_currency:
|
|
165
|
+
env.logger.info("Renaming currency from %s to %s", from_val, to_val)
|
|
166
|
+
tree_transformers.append(
|
|
167
|
+
functools.partial(rename_commodity_transform, dict(rename_currency))
|
|
168
|
+
)
|
|
169
|
+
|
|
68
170
|
# TODO: support follow include statements
|
|
69
171
|
parser = make_parser()
|
|
70
172
|
if stdin_mode:
|
|
@@ -88,6 +190,16 @@ def main(
|
|
|
88
190
|
)
|
|
89
191
|
for filepath, tree in iterator:
|
|
90
192
|
env.logger.info("Processing file %s", filepath)
|
|
193
|
+
if tree_transformers:
|
|
194
|
+
env.logger.info(
|
|
195
|
+
"Running %s transforms against file %s ...",
|
|
196
|
+
len(tree_transformers),
|
|
197
|
+
filepath,
|
|
198
|
+
)
|
|
199
|
+
tree = walk_tree(
|
|
200
|
+
tree,
|
|
201
|
+
functools.partial(combine_transforms, tree_transformers),
|
|
202
|
+
)
|
|
91
203
|
with tempfile.NamedTemporaryFile(mode="wt+", suffix=".bean") as output_file:
|
|
92
204
|
formatter = Formatter()
|
|
93
205
|
formatter.format(tree, output_file)
|