"""accuweather-client: a human-friendly Python client for the AccuWeather API.

Address locations the way people do - by city name, point of interest, or
coordinates - and get typed, documented pydantic models back.

Quick start:
    >>> from accuweather_client import WeatherClient
    >>> client = WeatherClient(token="your-api-key", city="sydney")
    >>> client.get_current_conditions().current_conditions
    >>> client.get_5day_forecast().forecast_tomorrow

See https://github.com/Thomas1942/AccuWeather for full documentation.
"""

__version__ = "2.0.0"

from accuweather_client.clients.location import (  # noqa: E402
    LocationClient,
    get_location_model,
)
from accuweather_client.clients.weather import WeatherClient  # noqa: E402
from accuweather_client.exceptions import (  # noqa: E402
    AccuWeatherError,
    ApiRequestError,
    ApiServerError,
    InvalidTokenError,
    LocationNotFoundError,
    RateLimitExceededError,
)
from accuweather_client.icons import (  # noqa: E402
    icon_to_description,
    icon_to_emoji,
)

__all__ = [
    "AccuWeatherError",
    "ApiRequestError",
    "ApiServerError",
    "AsyncWeatherClient",
    "InvalidTokenError",
    "LocationClient",
    "LocationNotFoundError",
    "RateLimitExceededError",
    "WeatherClient",
    "__version__",
    "get_location_model",
    "icon_to_description",
    "icon_to_emoji",
]


def __getattr__(name: str):
    """Lazily import the async client so httpx stays an optional extra."""
    if name == "AsyncWeatherClient":
        from accuweather_client.clients.async_weather import (
            AsyncWeatherClient,
        )

        return AsyncWeatherClient
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
