elody 0.0.177__tar.gz → 0.0.179__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 (52) hide show
  1. {elody-0.0.177 → elody-0.0.179}/PKG-INFO +1 -1
  2. {elody-0.0.177 → elody-0.0.179}/pyproject.toml +1 -1
  3. {elody-0.0.177 → elody-0.0.179}/src/elody/csv.py +13 -0
  4. {elody-0.0.177 → elody-0.0.179}/src/elody/object_configurations/base_object_configuration.py +10 -5
  5. {elody-0.0.177 → elody-0.0.179}/src/elody.egg-info/PKG-INFO +1 -1
  6. {elody-0.0.177 → elody-0.0.179}/LICENSE +0 -0
  7. {elody-0.0.177 → elody-0.0.179}/README.md +0 -0
  8. {elody-0.0.177 → elody-0.0.179}/setup.cfg +0 -0
  9. {elody-0.0.177 → elody-0.0.179}/src/__init__.py +0 -0
  10. {elody-0.0.177 → elody-0.0.179}/src/elody/__init__.py +0 -0
  11. {elody-0.0.177 → elody-0.0.179}/src/elody/client.py +0 -0
  12. {elody-0.0.177 → elody-0.0.179}/src/elody/error_codes.py +0 -0
  13. {elody-0.0.177 → elody-0.0.179}/src/elody/exceptions.py +0 -0
  14. {elody-0.0.177 → elody-0.0.179}/src/elody/job.py +0 -0
  15. {elody-0.0.177 → elody-0.0.179}/src/elody/loader.py +0 -0
  16. {elody-0.0.177 → elody-0.0.179}/src/elody/migration/__init__.py +0 -0
  17. {elody-0.0.177 → elody-0.0.179}/src/elody/migration/base_object_migrator.py +0 -0
  18. {elody-0.0.177 → elody-0.0.179}/src/elody/object_configurations/__init__.py +0 -0
  19. {elody-0.0.177 → elody-0.0.179}/src/elody/object_configurations/elody_configuration.py +0 -0
  20. {elody-0.0.177 → elody-0.0.179}/src/elody/object_configurations/job_configuration.py +0 -0
  21. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/__init__.py +0 -0
  22. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authentication/__init__.py +0 -0
  23. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authentication/base_user_tenant_validation_policy.py +0 -0
  24. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authentication/multi_tenant_policy.py +0 -0
  25. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/__init__.py +0 -0
  26. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/filter_generic_objects_policy.py +0 -0
  27. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py +0 -0
  28. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/generic_object_detail_policy.py +0 -0
  29. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/generic_object_mediafiles_policy.py +0 -0
  30. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/generic_object_metadata_policy.py +0 -0
  31. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/generic_object_relations_policy.py +0 -0
  32. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/generic_object_request_policy.py +0 -0
  33. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/generic_object_request_policy_v2.py +0 -0
  34. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/mediafile_derivatives_policy.py +0 -0
  35. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/mediafile_download_policy.py +0 -0
  36. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/multi_tenant_policy.py +0 -0
  37. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/authorization/tenant_request_policy.py +0 -0
  38. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/helpers.py +0 -0
  39. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/permission_handler.py +0 -0
  40. {elody-0.0.177 → elody-0.0.179}/src/elody/policies/tenant_id_resolver.py +0 -0
  41. {elody-0.0.177 → elody-0.0.179}/src/elody/schemas.py +0 -0
  42. {elody-0.0.177 → elody-0.0.179}/src/elody/util.py +0 -0
  43. {elody-0.0.177 → elody-0.0.179}/src/elody/validator.py +0 -0
  44. {elody-0.0.177 → elody-0.0.179}/src/elody.egg-info/SOURCES.txt +0 -0
  45. {elody-0.0.177 → elody-0.0.179}/src/elody.egg-info/dependency_links.txt +0 -0
  46. {elody-0.0.177 → elody-0.0.179}/src/elody.egg-info/requires.txt +0 -0
  47. {elody-0.0.177 → elody-0.0.179}/src/elody.egg-info/top_level.txt +0 -0
  48. {elody-0.0.177 → elody-0.0.179}/src/tests/__init_.py +0 -0
  49. {elody-0.0.177 → elody-0.0.179}/src/tests/data.py +0 -0
  50. {elody-0.0.177 → elody-0.0.179}/src/tests/unit/__init__.py +0 -0
  51. {elody-0.0.177 → elody-0.0.179}/src/tests/unit/test_csv.py +0 -0
  52. {elody-0.0.177 → elody-0.0.179}/src/tests/unit/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: elody
3
- Version: 0.0.177
3
+ Version: 0.0.179
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "elody"
9
- version = "0.0.177"
9
+ version = "0.0.179"
10
10
  description = "elody SDK for Python"
11
11
  readme = "README.md"
12
12
  authors = [{ name = "Inuits", email = "developers@inuits.eu" }]
@@ -11,6 +11,7 @@ from elody.exceptions import (
11
11
  )
12
12
  from elody.validator import validate_json
13
13
  from elody.schemas import entity_schema, mediafile_schema
14
+ from dateutil import parser
14
15
 
15
16
 
16
17
  class CSVParser:
@@ -207,6 +208,16 @@ class CSVMultiObject(CSVParser):
207
208
  return False
208
209
  return bool(value)
209
210
 
211
+ def is_datetime(self, value):
212
+ try:
213
+ parser.parse(value)
214
+ return True
215
+ except (ValueError, TypeError):
216
+ return False
217
+
218
+ def parse_datetime(self, value):
219
+ return parser.parse(value)
220
+
210
221
  def __fill_objects_from_csv(self):
211
222
  indexed_dict = dict()
212
223
  external_mediafiles_ids = []
@@ -300,6 +311,8 @@ class CSVMultiObject(CSVParser):
300
311
  metadata_key = metadata_info.get("map_to", key)
301
312
  indexed_dict[type][id].setdefault("metadata", list())
302
313
  options = metadata_info.get("value_options")
314
+ if self.is_datetime(value):
315
+ value = self.parse_datetime(value)
303
316
  if options and value not in options:
304
317
  if "invalid_value" not in self.get_errors():
305
318
  self.set_error("invalid_value", list())
@@ -17,8 +17,8 @@ class BaseObjectConfiguration(ABC):
17
17
  overwrite=overwrite,
18
18
  **kwargs,
19
19
  ),
20
- "nested_matcher_builder": lambda object_lists, keys_info, value: self.__build_nested_matcher(
21
- object_lists, keys_info, value
20
+ "nested_matcher_builder": lambda object_lists, keys_info, value, **kwargs: self.__build_nested_matcher(
21
+ object_lists, keys_info, value, **kwargs
22
22
  ),
23
23
  "post_crud_hook": lambda **kwargs: None,
24
24
  "pre_crud_hook": lambda *, document, **kwargs: document,
@@ -142,11 +142,16 @@ class BaseObjectConfiguration(ABC):
142
142
  sort_keys(document)
143
143
  return document
144
144
 
145
- def __build_nested_matcher(self, object_lists, keys_info, value, index=0):
145
+ def __build_nested_matcher(
146
+ self, object_lists, keys_info, value, *, index=0, **kwargs
147
+ ):
146
148
  if index == 0 and not any(info["object_list"] for info in keys_info):
147
149
  if value in ["ANY_MATCH", "NONE_MATCH"]:
148
150
  value = {"$exists": value == "ANY_MATCH"}
149
- return {".".join(info["key"] for info in keys_info): value}
151
+ matcher = {".".join(info["key"] for info in keys_info): value}
152
+ if inner_exact_matches := kwargs.get("inner_exact_matches"):
153
+ matcher.update(inner_exact_matches)
154
+ return matcher
150
155
 
151
156
  info = keys_info[index]
152
157
 
@@ -155,7 +160,7 @@ class BaseObjectConfiguration(ABC):
155
160
  "$elemMatch": {
156
161
  object_lists[info["object_list"]]: info["object_key"],
157
162
  **self.__build_nested_matcher(
158
- object_lists, keys_info[index + 1 :], value, 0
163
+ object_lists, keys_info[index + 1 :], value, index=0, **kwargs
159
164
  ),
160
165
  }
161
166
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: elody
3
- Version: 0.0.177
3
+ Version: 0.0.179
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes