aiozoneinfo is an asyncio-compatible Python library that provides tools to asynchronously fetch and access zoneinfo timezone data. It integrates seamlessly with asynchronous applications requiring up-to-date timezone information. The current version is 0.2.3, with a release cadence focused on minor fixes and improvements.
pip install aiozoneinfoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `ZoneInfo` client and asynchronously fetch timezone data using `async_get_timezone`. It also includes basic error handling for invalid timezone names.
Ensure stable network connectivity. Implement retry mechanisms or local caching for resilience in production environments.
Always use valid IANA Time Zone Database names (e.g., 'America/New_York', 'Europe/London'). Consider validating user input against a known list of timezones.
Prefix all `aiozoneinfo` method calls with `await`. Wrap your top-level async function with `asyncio.run()` when running from a synchronous context.