From 9c06c64ae400f94950549024c117a8959e682789 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 28 Sep 2022 15:35:21 +0200 Subject: [PATCH] Fix: lot, type and locataire extraction --- pdf_oralia/extract_locataire.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/pdf_oralia/extract_locataire.py b/pdf_oralia/extract_locataire.py index 8114d31..b77987b 100644 --- a/pdf_oralia/extract_locataire.py +++ b/pdf_oralia/extract_locataire.py @@ -5,18 +5,11 @@ import pandas as pd def parse_above_loc(content): row = {} - try: - app, loc = content.split("\n") - except ValueError: - row["lot"] = "" - row["type"] = "" - row["locataire"] = content - - else: - app_ = app.split(" ") - row["lot"] = app_[1] - row["type"] = " ".join(app_[2:]) - row["locataire"] = loc + app, loc, *_ = content.split("\n") + app_ = app.split(" ") + row["lot"] = app_[1] + row["type"] = " ".join(app_[2:]) + row["locataire"] = loc return pd.Series(row)