From 99e8e8d303ab5038d659ff1111b11c6a294c96a7 Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sat, 5 Jul 2025 19:58:19 +0200 Subject: [PATCH] examples: Use cachier as cache --- examples/README.md | 8 ++++++-- examples/importers/acme.py | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/README.md b/examples/README.md index af73909c..d8af75dd 100644 --- a/examples/README.md +++ b/examples/README.md @@ -104,14 +104,18 @@ fava`) because this still has beancount v2.3.6 pinned (if you need fava, install in a different venv). Also, if you want to run the example folder fully, including pdf2text extraction, -install the following dependencies for pdftotext: +install the following dependencies: ```bash +# Contains pdf2text apt-get install poppler-utils + +# Caching lib used in the example +pip install cachier ``` Now run beancount with the beangulp importer: ```bash python import.py extract ./Downloads > tmp.beancount -``` \ No newline at end of file +``` diff --git a/examples/importers/acme.py b/examples/importers/acme.py index 701637d0..56f0e2a6 100644 --- a/examples/importers/acme.py +++ b/examples/importers/acme.py @@ -13,15 +13,15 @@ import re import subprocess +from cachier import cachier from dateutil.parser import parse as parse_datetime import beangulp from beangulp import mimetypes -from beangulp.cache import cache from beangulp.testing import main -@cache +@cachier() def pdf_to_text(filename): """Convert a PDF document to a text equivalent.""" r = subprocess.run(["pdftotext", filename, "-"], stdout=subprocess.PIPE, check=True)