Fix: run pre-commit

This commit is contained in:
Bertrand Benjamin 2022-09-27 15:01:14 +02:00
parent ba96211923
commit a2ac6c3c88

View File

@ -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()