Remove config dependency

This commit is contained in:
Benjamin Loison 2023-11-05 21:10:45 +01:00
parent 6f97554195
commit 480072779c
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -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+')