singleScrape_of_region eingefügt

main
mmaurostoffel 2025-01-12 16:53:31 +01:00
parent 67c0d85213
commit c059890ba7
1 changed files with 15 additions and 0 deletions

View File

@ -443,6 +443,21 @@ class Database:
properties.seed_id = {region_id} properties.seed_id = {region_id}
""") """)
def singleScrape_of_region(self, region_id: int, scrape_date_min: str, scrape_date_max: str):
return self.connection.sql(f"""
SELECT
JSON_EXTRACT(body, '$.content.days') as calendarBody,
FROM
consultancy_d.extractions
LEFT JOIN
consultancy_d.properties ON properties.id = extractions.property_id
WHERE
type == 'calendar' AND
properties.seed_id = {region_id} AND
extractions.created_at >= '{scrape_date_min}' AND
extractions.created_at < '{scrape_date_max}'
""")
def capacity_global(self): def capacity_global(self):
return self.connection.sql(f""" return self.connection.sql(f"""
SELECT SELECT