diff --git a/images/beancount-import/.dockerignore b/images/beancount-import/.dockerignore deleted file mode 100644 index 4a246ec..0000000 --- a/images/beancount-import/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -Dockerfile -.dockerignore diff --git a/images/beancount-import/Dockerfile b/images/beancount-import/Dockerfile deleted file mode 100644 index 81c9a7f..0000000 --- a/images/beancount-import/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM python:3.12.6-slim - -COPY requirements.txt /tmp - -RUN set -eux; \ - pip3 install --break-system-packages -r /tmp/requirements.txt; \ - rm -rf \ - /root/.cache \ - /tmp/requirements.txt \ - ; - -WORKDIR /beancount-import -COPY . . - -ENV BEANCOUNT_IMPORT_ARGS="" \ - BEANCOUNT_IMPORT_JOURNAL_DIR="/beancount-import/journal" \ - BEANCOUNT_IMPORT_DATA_DIR="/beancount-import/data" - -EXPOSE 8080 - -VOLUME ${BEANCOUNT_IMPORT_DATA_DIR} -VOLUME ${BEANCOUNT_IMPORT_JOURNAL_DIR} - -CMD [ "python3", "/beancount-import/run.py", "--address", "0.0.0.0", "--port", "8080", "${BEANCOUNT_IMPORT_ARGS}" ] diff --git a/images/beancount-import/_config.py b/images/beancount-import/_config.py deleted file mode 100644 index 055a709..0000000 --- a/images/beancount-import/_config.py +++ /dev/null @@ -1,45 +0,0 @@ -""" -This config is where you would initialize your importers with personal info -like account number or credit card last4 digit. - -you may also define CONFIG:List[ImporterProtocol] for other beancount tools like -bean-identify, bean-file, and other beancount scripts to use -eg. `bean-identify _config.py ~/Downloads` -to identify the files that importers defined here can process - - -beancount-import should have it's own run.py where you invoke the -`beancount_import.webserver.main` but import the Importer objects from this config - -This is the way!! -""" -from beancount.ingest.importers.csv import Importer as CSVImporter, Col - -my_foobar_bank_importer = CSVImporter( - { - Col.DATE: "Date", - Col.NARRATION1: "Description", - Col.AMOUNT: "Amount", - }, - "Assets:FooBarBank", # account - "EUR", # currency - # regexps used by ImporterProtocol.identify() to identify the correct file - '"Date","Description","Amount"', -) - -my_amex_cc_importer = CSVImporter( - { - Col.DATE: "Date", - Col.NARRATION1: "Description", - Col.AMOUNT: "Amount", - Col.BALANCE: "Balance", - }, - "Liabilities:Amex-Credit-Card", # account - "EUR", # currency - # regexps used by ImporterProtocol.identify() to identify the correct file - ("Date,Description,Amount,Balance", "Credit.*7890"), - skip_lines=1, -) - -# beancount's scripts use this -CONFIG = [my_foobar_bank_importer, my_amex_cc_importer] diff --git a/images/beancount-import/requirements.txt b/images/beancount-import/requirements.txt deleted file mode 100644 index 33c2bb0..0000000 --- a/images/beancount-import/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# beancount-import doesn't specify this constraint itself, but is also -# not compatible with v3. So we need to ensure this here. -beancount<3.0.0 -beancount-import==1.4.0 -smart_importer==0.5 diff --git a/images/beancount-import/run.py b/images/beancount-import/run.py deleted file mode 100644 index 21f3c5d..0000000 --- a/images/beancount-import/run.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys - -from _config import data_sources - - -def run_reconcile(extra_args): - import beancount_import.webserver - - journal_dir = os.environ["BEANCOUNT_IMPORT_JOURNAL_DIR"] - - beancount_import.webserver.main( - extra_args, - journal_input=os.path.join(journal_dir, "main.beancount"), - ignored_journal=os.path.join(journal_dir, "ignored.beancount"), - default_output=os.path.join(journal_dir, "main.beancount"), - open_account_output_map=[ - (".*", os.path.join(journal_dir, "accounts.beancount")), - ], - balance_account_output_map=[ - (".*", os.path.join(journal_dir, "accounts.beancount")), - ], - price_output=os.path.join(journal_dir, "prices.beancount"), - data_sources=data_sources, - ) - - -if __name__ == "__main__": - run_reconcile(sys.argv[1:]) diff --git a/pipelines/build-and-push.json b/pipelines/build-and-push.json index 6a452c1..43042ce 100644 --- a/pipelines/build-and-push.json +++ b/pipelines/build-and-push.json @@ -36,10 +36,6 @@ "type": "simple", "name": "forgejo" }, - { - "type": "simple", - "name": "beancount-import" - }, { "type": "simple", "name": "frp"