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)