python-easyverein 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/PKG-INFO +1 -1
  2. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/__init__.py +1 -1
  3. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/core/client.py +11 -1
  4. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/core/exceptions.py +6 -0
  5. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/pyproject.toml +1 -1
  6. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/LICENSE +0 -0
  7. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/README.md +0 -0
  8. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/api.py +0 -0
  9. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/core/__init__.py +0 -0
  10. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/core/protocol.py +0 -0
  11. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/core/types.py +0 -0
  12. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/core/validators.py +0 -0
  13. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/__init__.py +0 -0
  14. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/base.py +0 -0
  15. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/contact_details.py +0 -0
  16. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/custom_field.py +0 -0
  17. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/invoice.py +0 -0
  18. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/invoice_item.py +0 -0
  19. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/member.py +0 -0
  20. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/member_custom_field.py +0 -0
  21. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/mixins/__init__.py +0 -0
  22. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/mixins/empty_strings_mixin.py +0 -0
  23. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/models/mixins/required_attributes.py +0 -0
  24. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/__init__.py +0 -0
  25. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/contact_details.py +0 -0
  26. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/custom_field.py +0 -0
  27. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/invoice.py +0 -0
  28. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/invoice_item.py +0 -0
  29. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/member.py +0 -0
  30. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/member_custom_field.py +0 -0
  31. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/mixins/__init__.py +0 -0
  32. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/mixins/crud.py +0 -0
  33. {python_easyverein-0.2.0 → python_easyverein-0.2.1}/easyverein/modules/mixins/recycle_bin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-easyverein
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Python library to interact with the EasyVerein API
5
5
  Author: Daniel Herrmann
6
6
  Author-email: daniel.herrmann1@gmail.com
@@ -2,7 +2,7 @@
2
2
  Middleware for FastAPI that supports authenticating users against Keycloak
3
3
  """
4
4
 
5
- __version__ = "0.2.0"
5
+ __version__ = "0.2.1"
6
6
 
7
7
  # Export EasyVerein API directly
8
8
  from .api import EasyvereinAPI # noqa: F401
@@ -103,13 +103,23 @@ class EasyvereinClient:
103
103
 
104
104
  if res.status_code == 429:
105
105
  retry_after = res.headers["Retry-After"]
106
+
107
+ try:
108
+ retry_after = int(retry_after)
109
+ except ValueError:
110
+ self.logger.error(
111
+ "Unable to parse Retry-After header while handling 429 response code."
112
+ )
113
+ self.logger.debug("Retry-After header: %s", retry_after)
114
+ retry_after = 0
115
+
106
116
  self.logger.warning(
107
117
  "Request returned status code 429, too many requests. Wait %d seconds",
108
118
  retry_after,
109
119
  )
110
120
  raise EasyvereinAPITooManyRetriesException(
111
- retry_after,
112
121
  f"Too many requests, please wait {retry_after} seconds and try again.",
122
+ retry_after=retry_after,
113
123
  )
114
124
 
115
125
  if res.status_code == 404:
@@ -21,4 +21,10 @@ class EasyvereinAPITooManyRetriesException(EasyvereinAPIException):
21
21
  Exception if the API returns a 429 Too Many Requests error
22
22
  """
23
23
 
24
+ def __init__(self, message, retry_after: int = 0):
25
+ # Call the base class constructor with the parameters it needs
26
+ super().__init__(message)
27
+
28
+ self.retry_after = retry_after
29
+
24
30
  retry_after = 0
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-easyverein"
3
- version = "0.2.0"
3
+ version = "0.2.1"
4
4
  description = "Python library to interact with the EasyVerein API"
5
5
  authors = ["Daniel Herrmann <daniel.herrmann1@gmail.com>"]
6
6
  readme = "README.md"