Python pyton3 Projects
-
-
InfluxDB
InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
-
import time import requests import asyncio import aiohttp urls = [ 'https://example.com', 'https://httpbin.org/get', 'https://python.org' ] # Synchronous version def sync_fetch(): for url in urls: response = requests.get(url) print(f"{url} fetched with {len(response.text)} characters") # Async version async def async_fetch(): async with aiohttp.ClientSession() as session: tasks = [session.get(url) for url in urls] responses = await asyncio.gather(*tasks) for i, resp in enumerate(responses): text = await resp.text() print(f"{urls[i]} fetched with {len(text)} characters") if __name__ == "__main__": print("Running synchronous fetch") start = time.perf_counter() sync_fetch() duration_sync = time.perf_counter() - start print(f"Synchronous fetching took {duration_sync:.2f} seconds\n") print("Running asynchronous fetch") start = time.perf_counter() asyncio.run(async_fetch()) duration_async = time.perf_counter() - start print(f"Asynchronous fetching took {duration_async:.2f} seconds")
Python pyton3 discussion
Index
| # | Project | Stars |
|---|---|---|
| 1 | fastapi_cache | 222 |
| 2 | Python | 16 |