python-datamodel 0.10.1__cp313-cp313-win32.whl

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 (78) hide show
  1. datamodel/__init__.py +13 -0
  2. datamodel/abstract.py +383 -0
  3. datamodel/adaptive/__init__.py +0 -0
  4. datamodel/adaptive/models.py +598 -0
  5. datamodel/aliases/__init__.py +26 -0
  6. datamodel/base.py +180 -0
  7. datamodel/converters.c +43471 -0
  8. datamodel/converters.cp313-win32.pyd +0 -0
  9. datamodel/converters.html +17387 -0
  10. datamodel/converters.pyx +1489 -0
  11. datamodel/exceptions.c +13455 -0
  12. datamodel/exceptions.cp313-win32.pyd +0 -0
  13. datamodel/exceptions.html +1261 -0
  14. datamodel/exceptions.pxd +13 -0
  15. datamodel/exceptions.pyx +50 -0
  16. datamodel/fields.cp313-win32.pyd +0 -0
  17. datamodel/fields.cpp +17401 -0
  18. datamodel/fields.html +3912 -0
  19. datamodel/fields.pyx +309 -0
  20. datamodel/functions.cp313-win32.pyd +0 -0
  21. datamodel/functions.cpp +9068 -0
  22. datamodel/functions.html +1766 -0
  23. datamodel/functions.pxd +9 -0
  24. datamodel/functions.pyx +82 -0
  25. datamodel/jsonld/__init__.py +45 -0
  26. datamodel/jsonld/models.py +500 -0
  27. datamodel/libs/__init__.py +1 -0
  28. datamodel/libs/mapping.c +15067 -0
  29. datamodel/libs/mapping.cp313-win32.pyd +0 -0
  30. datamodel/libs/mapping.html +2618 -0
  31. datamodel/libs/mapping.pxd +11 -0
  32. datamodel/libs/mapping.pyx +135 -0
  33. datamodel/libs/mutables.py +127 -0
  34. datamodel/models.py +814 -0
  35. datamodel/parsers/__init__.py +0 -0
  36. datamodel/parsers/encoders.py +15 -0
  37. datamodel/parsers/json.cp313-win32.pyd +0 -0
  38. datamodel/parsers/json.cpp +17004 -0
  39. datamodel/parsers/json.html +3365 -0
  40. datamodel/parsers/json.pyx +250 -0
  41. datamodel/profiler.py +21 -0
  42. datamodel/py.typed +0 -0
  43. datamodel/rs_core/Cargo.toml +17 -0
  44. datamodel/rs_core/src/lib.rs +294 -0
  45. datamodel/rs_parsers/Cargo.toml +22 -0
  46. datamodel/rs_parsers/src/lib.rs +571 -0
  47. datamodel/rs_parsers.cp313-win32.pyd +0 -0
  48. datamodel/rs_validators/Cargo.toml +17 -0
  49. datamodel/rs_validators/src/lib.rs +0 -0
  50. datamodel/typedefs/__init__.py +9 -0
  51. datamodel/typedefs/singleton.c +9169 -0
  52. datamodel/typedefs/singleton.cp313-win32.pyd +0 -0
  53. datamodel/typedefs/singleton.html +629 -0
  54. datamodel/typedefs/singleton.pxd +9 -0
  55. datamodel/typedefs/singleton.pyx +24 -0
  56. datamodel/typedefs/types.c +11716 -0
  57. datamodel/typedefs/types.cp313-win32.pyd +0 -0
  58. datamodel/typedefs/types.html +732 -0
  59. datamodel/typedefs/types.pxd +11 -0
  60. datamodel/typedefs/types.pyx +39 -0
  61. datamodel/types.c +7165 -0
  62. datamodel/types.cp313-win32.pyd +0 -0
  63. datamodel/types.html +716 -0
  64. datamodel/types.pyx +100 -0
  65. datamodel/validation.cp313-win32.pyd +0 -0
  66. datamodel/validation.cpp +17085 -0
  67. datamodel/validation.html +4769 -0
  68. datamodel/validation.pyx +315 -0
  69. datamodel/version.py +13 -0
  70. examples/nn/examples.py +311 -0
  71. examples/nn/stores.py +151 -0
  72. examples/tests/sp_types.py +294 -0
  73. examples/tests/speed_dates.py +26 -0
  74. python_datamodel-0.10.1.dist-info/LICENSE +29 -0
  75. python_datamodel-0.10.1.dist-info/METADATA +320 -0
  76. python_datamodel-0.10.1.dist-info/RECORD +78 -0
  77. python_datamodel-0.10.1.dist-info/WHEEL +5 -0
  78. python_datamodel-0.10.1.dist-info/top_level.txt +7 -0
@@ -0,0 +1,13 @@
1
+ # cython: language_level=3, embedsignature=True, boundscheck=False, wraparound=True, initializedcheck=False
2
+ # Copyright (C) 2018-present Jesus Lara
3
+ #
4
+ """DataModel Exceptions."""
5
+ cdef class ModelException(Exception):
6
+ """Base class for other exceptions"""
7
+
8
+ ## Other Errors:
9
+ cdef class ValidationError(ModelException):
10
+ pass
11
+
12
+ cdef class ParserError(ModelException):
13
+ pass
@@ -0,0 +1,50 @@
1
+ # cython: language_level=3, embedsignature=True, boundscheck=False, wraparound=True, initializedcheck=False
2
+ # Copyright (C) 2018-present Jesus Lara
3
+ #
4
+ cdef class ModelException(Exception):
5
+ """Base class for other Data-Model exceptions"""
6
+
7
+ def __init__(self, str message, **kwargs):
8
+ super().__init__(message)
9
+ self.stacktrace = None
10
+ if 'stacktrace' in kwargs:
11
+ self.stacktrace = kwargs['stacktrace']
12
+ self.message = message
13
+ self.args = kwargs
14
+
15
+ def __repr__(self):
16
+ return f"{self.message}"
17
+
18
+ def __str__(self):
19
+ return f"{self.message!s}"
20
+
21
+ def get(self):
22
+ return self.message
23
+
24
+ cdef class ValidationError(ModelException):
25
+ """Validation Error."""
26
+ def __init__(self, str message, dict payload = None):
27
+ super().__init__(message)
28
+ self.payload = payload or {}
29
+
30
+ def __str__(self):
31
+ base = super().__str__()
32
+ if self.payload:
33
+ # collect the keys that had errors
34
+ field_names = ", ".join(self.payload.keys())
35
+ # attach them to the base message so we see them in the final str
36
+ return f"{base} (Fields with errors: {field_names})"
37
+ else:
38
+ return base
39
+
40
+ cdef class ParsingError(ModelException):
41
+ """Parsing Error."""
42
+ def __init__(self, str message):
43
+ message = f'Parsing Error: {message}'
44
+ super().__init__(message)
45
+
46
+ cdef class ParserError(ModelException):
47
+ """Parsing Error."""
48
+ def __init__(self, str message):
49
+ message = f'Parsing Error: {message}'
50
+ super().__init__(message)
Binary file