From a2ac6c3c88a4b545503a3881d5c4f0cb1d94b8f1 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 27 Sep 2022 15:01:14 +0200 Subject: [PATCH] Fix: run pre-commit --- pdf_auralia/extract.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pdf_auralia/extract.py b/pdf_auralia/extract.py index 48710bf..62bdc38 100644 --- a/pdf_auralia/extract.py +++ b/pdf_auralia/extract.py @@ -1,8 +1,9 @@ -import pandas as pd -import numpy as np -import pdfplumber from pathlib import Path + import click +import numpy as np +import pandas as pd +import pdfplumber def extract_situation_loc(table): @@ -50,8 +51,8 @@ def extract_charge(table): .dropna(subset=["Débits"]) ) drop_index = df[ - df["RECAPITULATIF DES OPERATIONS"].str.contains("TOTAUX", case=False) or - df["RECAPITULATIF DES OPERATIONS"].str.contains("solde", case=False) + df["RECAPITULATIF DES OPERATIONS"].str.contains("TOTAUX", case=False) + or df["RECAPITULATIF DES OPERATIONS"].str.contains("solde", case=False) ].index df.drop(drop_index, inplace=True) return df @@ -97,6 +98,7 @@ def extract_save(pdf_file): pdf = pdfplumber.open(pdf_file) extract_from_pdf(pdf, xls_charge, xls_locataire) + @click.command() @click.option("--pdf_file", help="Nom du fichier pdf", default="") @click.option("--folder", help="Tous les fichiers dans folder", default="./") @@ -110,7 +112,5 @@ def pdf2xlsx(pdf_file, folder): extract_save(pdf_file) - - if __name__ == "__main__": pdf2xlsx()