github waza-ari/python-easyverein v1.0.0

14 days ago

🎉 Version 1.0.0 is here! It comes with support for the EasyVerein 2.0 API and the new temporary tokens, support to manage member groups and member group associations, full type checking support and more! There are also some breaking changes. Together with the fact that we've been using this library in our own environment for more than a year now, I feel confident releasing a new major version.

Breaking Changes

💥 v1.7 is now the standard API version. If you do not specify an API version, the library now assumes v1.7 instead of v1.6. Supported versions for now include v1.6, v1.7 and as of this release v2.0. v1.6 is now deprecated and will be removed in a future release.
💥 Nested functions (including CRUD functions) that relate to a parent model (for example managing the custom fields of a member using the /api/v1.7/member/{userPk}/custom-fields endpoints do not expect the parent model identifier as additional parameter anymore, instead the parameter is moved to the parent namespace initialiser. In other words, managing custom fields of a member (not managing custom fields themselves) now works differently.

To switch to the new approach, the following changes need to be made:

# Old
ev_client.member_custom_field.get(member.id)

# You would now instead use
ev_client.member.custom_fields(member.id).get()

This applies to ev_client.member.custom_fields and the newly introduced ev_client.member.member_groups methods. You can read more in the respective documentation sections.

Features

✨ Support for EasyVerein API v2.0 including support for short lived tokens. A new method is introduced to obtain a new token, or you can optionally pass a callback function that the library calls when a token must be refreshed, so you can store it. More details can be found in the documentation section about how to handle token refresh.
✨ The API client now includes models for managing Member Groups, as well as member group associations (associate members to groups).
✨ Full type hinting is now available, with the introduction of proper Generics. It is known to work with Mypy and VSCode, the PyCharm linter does not fully support auto completion. I was unable to make this work, any support is much appreciated.

Bugfixes

✏️ fix: Pydantic serialization aliases are only used if by_alias is set to True
✏️ Mostly internal, but all type hints (mypy) have been fixed. This enables proper auto completion (see features). Also see refactor: introduce generic protocol to properly type CRUD methods
Fixed wrong type annotation for some optional filter fields

Full Changelog: v0.2.7...v1.0.0

Don't miss a new python-easyverein release

NewReleases is sending notifications on new releases.