The transition to v2 marked a significant architectural shift from sequential, blocking requests to a fully asynchronous model, resulting in a dramatic reduction in execution time.
- Parallel Execution: Leveraging
asyncio.gather, multiple independent API calls are fired concurrently, minimizing wait times. - Efficient Connections: Utilizing
aiohttp.ClientSessionensures connections are reused efficiently across the application loop. - Hybrid Flow: A strategic design where dependent data (like country coordinates) is fetched first, unlocking the parallel fetching of the remaining datasets.