|
from src.persistence.db import init_db |
|
from src.utils.apis.googlemaps_api import GoogleMapsAPI |
|
import re |
|
|
|
db = init_db() |
|
google_maps_api = GoogleMapsAPI() |
|
event_urls = db.event_urls.find({"final": True, "class": "EventDetail"}, |
|
{"_id": 1, "information": 1}) |
|
|
|
count = 0 |
|
for event in event_urls: |
|
information = event.get("information",{}) |
|
print(information) |
|
prices = information.get("actual",{}).get("prices", None) |
|
if prices: |
|
prices = [re.findall(r'\d+(?:[.,]\d+)?', price) for price in prices] |
|
|
|
prices = [p.replace(".", ",") + "€" for sublist in prices for p in sublist] |
|
information["actual"]["prices"] = prices |
|
print(information) |
|
|
|
schedule = information.get("actual",{}).get("dates",{}) |
|
if schedule: |
|
count = count + 1 |
|
print(count) |