7a92834c8b1e5126ff409484732ec852f59c9873
Open one psycopg2 connection in main() and pass it through pull_data_and_log and log_to_database. Previously each landing-zone insert opened its own connection (3-4 handshakes per invocation); now everything runs in a single session and the three LZ writes share one transaction. Other cleanups: - Replace bare `except:` blocks around attraction-field reads with .get() - Drop the unused col_names computation in the old generic_query - Move module-level driver code under `if __name__ == "__main__":` - Parse park_opens / park_closes once instead of three times - Name columns explicitly in the park-hours query (was SELECT *) - Use `datestamp` (date column) for the today-freshness check rather than reading .date() off the open timestamp Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The file is empty.
Description
Code for scraping website/attractions.io API for data related to attraction status and queue times
20 MiB
Languages
Jupyter Notebook
95.3%
Python
4.7%