latecomers/devloop/serialize.py
2022-08-25 21:39:32 +02:00

23 lines
576 B
Python

# -*- encoding: utf-8 -*-
import os
import pandas as pd
from latecomers.parse import find_table, get_details
from latecomers.serializer import to_excel
with open("./devloop/sample.html") as f:
content = f.read()
flights = find_table(content)
data = []
for f in flights:
data.append(get_details(f, os.environ.get("DEBUG") is not None))
print(to_excel(data))
colonne = {"th_arrival": "Arrivo teorico", "real_arrival": "Arrivo reale",
"code": "Codice volo", "origin": "Aeroporto di partenza", "status": "Stato"}
df = pd.DataFrame(data, columns=colonne)