- Add support for Metos' API v2: https://api.fieldclimate.com/v2/docs/ - How should we best support both users of v2 and v1, which should still be supported? - Need to assess how different the new API is before deciding on how to tackle this. - Increment major version to track with upstream.
High-level changes:
- Dropped
aiohttp
library in favor of usingasks
. - This adds support for asyncio, trio, and curio async loops.
- Dropped synchronous interface on FieldClimateClient. This means all client methods must now be awaited.
Implementation changes:
- Moved url validation functions from
fieldclimate.utils
tofieldclimate.clean
. These functions now raiseAssertionError
explicitly, asassert
statements can be switched off. - FieldClimateClient now inherits from
asks.Session
, which provides async context manager usage and connection rate limiting. - Removed BaseClient and HmacClient classes, unifying their functionality in FieldClimateClient.
- Added tests for trio and curio event loops.
Bonus changes:
- Added DjangoFieldClimateClient. This subclass gets your HMAC authentication keys from django's settings, which can save you a few lines of code if you already use django.
- Dropped
requests
library in favor of usingaiohttp
for both sync and async interfaces.
- Renamed all
station_id
method parameters tostation
, possibly breaking your code. - This argument can now handle an entire station dictionary, and will extract the station_id automatically.
- Initial PyPI release. 🎉