From 480072779c162159640689aab5321dc78de5fef8 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Sun, 5 Nov 2023 21:10:45 +0100 Subject: [PATCH] Remove `config` dependency --- bnp_pdf_statement_parser.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bnp_pdf_statement_parser.py b/bnp_pdf_statement_parser.py index cf9bda3..e036db4 100755 --- a/bnp_pdf_statement_parser.py +++ b/bnp_pdf_statement_parser.py @@ -2,9 +2,11 @@ # Depends on `pdftotext`. -import os, subprocess, re, config +import os +import subprocess +import re -path = f'/home/benjamin/Desktop/bens_folder/bazaar/documents/bnp/RLV_CHQ_{config.RLV_CHQ}' +path = f'/home/benjamin/Desktop/bens_folder/bazaar/documents/bnp/bank_statements/' os.chdir(path) @@ -23,7 +25,7 @@ def execute(command): return subprocess.check_output(command).decode('utf-8') def getTextFromPdf(pdfPath): - return execute(['pdftotext', '-raw', pdfPath, '-') + return execute(['pdftotext', '-raw', pdfPath, '-']) firstLineOfPaymentRegex = re.compile('\d{2}\.\d{2} \d{2}\.\d{2} \d+,\d{2}') endPageAfterTheFirstOneRegex = re.compile('P\. \d+/\d+')