marshmallow 3.25.0__py3-none-any.whl → 3.25.1__py3-none-any.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.
- marshmallow/class_registry.py +2 -4
- marshmallow/decorators.py +1 -1
- marshmallow/fields.py +48 -34
- marshmallow/schema.py +15 -14
- marshmallow/types.py +5 -0
- marshmallow/utils.py +9 -5
- marshmallow/validate.py +5 -5
- {marshmallow-3.25.0.dist-info → marshmallow-3.25.1.dist-info}/METADATA +16 -7
- marshmallow-3.25.1.dist-info/RECORD +18 -0
- marshmallow-3.25.0.dist-info/RECORD +0 -18
- {marshmallow-3.25.0.dist-info → marshmallow-3.25.1.dist-info}/LICENSE +0 -0
- {marshmallow-3.25.0.dist-info → marshmallow-3.25.1.dist-info}/WHEEL +0 -0
marshmallow/class_registry.py
CHANGED
|
@@ -74,15 +74,13 @@ def get_class(classname: str, all: typing.Literal[False] = ...) -> SchemaType: .
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
@typing.overload
|
|
77
|
-
def get_class(
|
|
78
|
-
classname: str, all: typing.Literal[True] = ...
|
|
79
|
-
) -> list[SchemaType] | SchemaType: ...
|
|
77
|
+
def get_class(classname: str, all: typing.Literal[True] = ...) -> list[SchemaType]: ...
|
|
80
78
|
|
|
81
79
|
|
|
82
80
|
def get_class(classname: str, all: bool = False) -> list[SchemaType] | SchemaType:
|
|
83
81
|
"""Retrieve a class from the registry.
|
|
84
82
|
|
|
85
|
-
:raises: marshmallow.exceptions.RegistryError if the class cannot be found
|
|
83
|
+
:raises: `marshmallow.exceptions.RegistryError` if the class cannot be found
|
|
86
84
|
or if there are multiple entries for the given class name.
|
|
87
85
|
"""
|
|
88
86
|
try:
|
marshmallow/decorators.py
CHANGED
|
@@ -86,7 +86,7 @@ class MarshmallowHook:
|
|
|
86
86
|
def validates(field_name: str) -> Callable[..., Any]:
|
|
87
87
|
"""Register a field validator.
|
|
88
88
|
|
|
89
|
-
:param
|
|
89
|
+
:param field_name: Name of the field that the method validates.
|
|
90
90
|
"""
|
|
91
91
|
return set_hook(None, VALIDATES, field_name=field_name)
|
|
92
92
|
|
marshmallow/fields.py
CHANGED
|
@@ -80,9 +80,7 @@ __all__ = [
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
class Field(FieldABC):
|
|
83
|
-
"""
|
|
84
|
-
formatting by default, and should only be used in cases where
|
|
85
|
-
data does not need to be formatted before being serialized or deserialized.
|
|
83
|
+
"""Base field from which other fields inherit.
|
|
86
84
|
|
|
87
85
|
:param dump_default: If set, this value will be used during serialization if the
|
|
88
86
|
input value is missing. If not set, the field will be excluded from the
|
|
@@ -114,7 +112,7 @@ class Field(FieldABC):
|
|
|
114
112
|
:param dump_only: If `True` skip this field during deserialization, otherwise
|
|
115
113
|
its value will be present in the deserialized object. In the context of an
|
|
116
114
|
HTTP API, this effectively marks the field as "read-only".
|
|
117
|
-
:param
|
|
115
|
+
:param error_messages: Overrides for `Field.default_error_messages`.
|
|
118
116
|
:param metadata: Extra information to be stored as field metadata.
|
|
119
117
|
|
|
120
118
|
.. versionchanged:: 3.0.0b8
|
|
@@ -123,6 +121,10 @@ class Field(FieldABC):
|
|
|
123
121
|
|
|
124
122
|
.. versionchanged:: 3.13.0
|
|
125
123
|
Replace ``missing`` and ``default`` parameters with ``load_default`` and ``dump_default``.
|
|
124
|
+
|
|
125
|
+
.. versionchanged:: 3.24.0
|
|
126
|
+
`Field <marshmallow.fields.Field>` should no longer be used as a field within a `Schema <marshmallow.Schema>`.
|
|
127
|
+
Use `Raw <marshmallow.fields.Raw>` or another `Field <marshmallow.fields.Field>` subclass instead.
|
|
126
128
|
"""
|
|
127
129
|
|
|
128
130
|
# Some fields, such as Method fields and Function fields, are not expected
|
|
@@ -148,11 +150,7 @@ class Field(FieldABC):
|
|
|
148
150
|
default: typing.Any = missing_,
|
|
149
151
|
data_key: str | None = None,
|
|
150
152
|
attribute: str | None = None,
|
|
151
|
-
validate:
|
|
152
|
-
typing.Callable[[typing.Any], typing.Any]
|
|
153
|
-
| typing.Iterable[typing.Callable[[typing.Any], typing.Any]]
|
|
154
|
-
| None
|
|
155
|
-
) = None,
|
|
153
|
+
validate: types.Validator | typing.Iterable[types.Validator] | None = None,
|
|
156
154
|
required: bool = False,
|
|
157
155
|
allow_none: bool | None = None,
|
|
158
156
|
load_only: bool = False,
|
|
@@ -260,9 +258,9 @@ class Field(FieldABC):
|
|
|
260
258
|
):
|
|
261
259
|
"""Return the value for a given key from an object.
|
|
262
260
|
|
|
263
|
-
:param
|
|
264
|
-
:param
|
|
265
|
-
:param
|
|
261
|
+
:param obj: The object to get the value from.
|
|
262
|
+
:param attr: The attribute/key in `obj` to get the value from.
|
|
263
|
+
:param accessor: A callable used to retrieve the value of `attr` from
|
|
266
264
|
the object `obj`. Defaults to `marshmallow.utils.get_value`.
|
|
267
265
|
"""
|
|
268
266
|
accessor_func = accessor or utils.get_value
|
|
@@ -381,8 +379,8 @@ class Field(FieldABC):
|
|
|
381
379
|
"""Update field with values from its parent schema. Called by
|
|
382
380
|
`Schema._bind_field <marshmallow.Schema._bind_field>`.
|
|
383
381
|
|
|
384
|
-
:param
|
|
385
|
-
:param
|
|
382
|
+
:param field_name: Field name set in schema.
|
|
383
|
+
:param schema: Parent object.
|
|
386
384
|
"""
|
|
387
385
|
self.parent = self.parent or schema
|
|
388
386
|
self.name = self.name or field_name
|
|
@@ -405,9 +403,9 @@ class Field(FieldABC):
|
|
|
405
403
|
return str(value).title()
|
|
406
404
|
|
|
407
405
|
:param value: The value to be serialized.
|
|
408
|
-
:param
|
|
409
|
-
:param
|
|
410
|
-
:param
|
|
406
|
+
:param attr: The attribute or key on the object to be serialized.
|
|
407
|
+
:param obj: The object the value was pulled from.
|
|
408
|
+
:param kwargs: Field-specific keyword arguments.
|
|
411
409
|
:return: The serialized value
|
|
412
410
|
"""
|
|
413
411
|
return value
|
|
@@ -710,9 +708,9 @@ class Pluck(Nested):
|
|
|
710
708
|
loaded = AlbumSchema().load(in_data) # => {'artist': {'id': 42}}
|
|
711
709
|
dumped = AlbumSchema().dump(loaded) # => {'artist': 42}
|
|
712
710
|
|
|
713
|
-
:param
|
|
711
|
+
:param nested: The Schema class or class name (string)
|
|
714
712
|
to nest, or ``"self"`` to nest the `Schema <marshmallow.Schema>` within itself.
|
|
715
|
-
:param
|
|
713
|
+
:param field_name: The key to pluck a value from.
|
|
716
714
|
:param kwargs: The same keyword arguments that :class:`Nested` receives.
|
|
717
715
|
"""
|
|
718
716
|
|
|
@@ -720,9 +718,14 @@ class Pluck(Nested):
|
|
|
720
718
|
self,
|
|
721
719
|
nested: Schema | SchemaMeta | str | typing.Callable[[], Schema],
|
|
722
720
|
field_name: str,
|
|
721
|
+
*,
|
|
722
|
+
many: bool = False,
|
|
723
|
+
unknown: str | None = None,
|
|
723
724
|
**kwargs,
|
|
724
725
|
):
|
|
725
|
-
super().__init__(
|
|
726
|
+
super().__init__(
|
|
727
|
+
nested, only=(field_name,), many=many, unknown=unknown, **kwargs
|
|
728
|
+
)
|
|
726
729
|
self.field_name = field_name
|
|
727
730
|
|
|
728
731
|
@property
|
|
@@ -832,8 +835,12 @@ class Tuple(Field):
|
|
|
832
835
|
#: Default error messages.
|
|
833
836
|
default_error_messages = {"invalid": "Not a valid tuple."}
|
|
834
837
|
|
|
835
|
-
def __init__(
|
|
836
|
-
|
|
838
|
+
def __init__(
|
|
839
|
+
self,
|
|
840
|
+
tuple_fields: typing.Iterable[Field] | typing.Iterable[type[Field]],
|
|
841
|
+
**kwargs,
|
|
842
|
+
):
|
|
843
|
+
super().__init__(**kwargs)
|
|
837
844
|
if not utils.is_collection(tuple_fields):
|
|
838
845
|
raise ValueError(
|
|
839
846
|
"tuple_fields must be an iterable of Field classes or " "instances."
|
|
@@ -948,8 +955,12 @@ _NumType = typing.TypeVar("_NumType")
|
|
|
948
955
|
class Number(Field, typing.Generic[_NumType]):
|
|
949
956
|
"""Base class for number fields.
|
|
950
957
|
|
|
951
|
-
:param
|
|
958
|
+
:param as_string: If `True`, format the serialized value as a string.
|
|
952
959
|
:param kwargs: The same keyword arguments that :class:`Field` receives.
|
|
960
|
+
|
|
961
|
+
.. versionchanged:: 3.24.0
|
|
962
|
+
`Number <marshmallow.fields.Number>` should no longer be used as a field within a `Schema <marshmallow.Schema>`.
|
|
963
|
+
Use `Integer <marshmallow.fields.Integer>`, `Float <marshmallow.fields.Float>`, or `Decimal <marshmallow.fields.Decimal>` instead.
|
|
953
964
|
"""
|
|
954
965
|
|
|
955
966
|
num_type: type = float
|
|
@@ -1027,9 +1038,9 @@ class Integer(Number[int]):
|
|
|
1027
1038
|
class Float(Number[float]):
|
|
1028
1039
|
"""A double as an IEEE-754 double precision string.
|
|
1029
1040
|
|
|
1030
|
-
:param
|
|
1041
|
+
:param allow_nan: If `True`, `NaN`, `Infinity` and `-Infinity` are allowed,
|
|
1031
1042
|
even though they are illegal according to the JSON specification.
|
|
1032
|
-
:param
|
|
1043
|
+
:param as_string: If `True`, format the value as a string.
|
|
1033
1044
|
:param kwargs: The same keyword arguments that :class:`Number` receives.
|
|
1034
1045
|
"""
|
|
1035
1046
|
|
|
@@ -1196,8 +1207,8 @@ class Boolean(Field):
|
|
|
1196
1207
|
def __init__(
|
|
1197
1208
|
self,
|
|
1198
1209
|
*,
|
|
1199
|
-
truthy:
|
|
1200
|
-
falsy:
|
|
1210
|
+
truthy: typing.Iterable | None = None,
|
|
1211
|
+
falsy: typing.Iterable | None = None,
|
|
1201
1212
|
**kwargs,
|
|
1202
1213
|
):
|
|
1203
1214
|
super().__init__(**kwargs)
|
|
@@ -1555,7 +1566,7 @@ class TimeDelta(Field):
|
|
|
1555
1566
|
|
|
1556
1567
|
|
|
1557
1568
|
class Mapping(Field):
|
|
1558
|
-
"""An abstract class for objects with key-value pairs.
|
|
1569
|
+
"""An abstract class for objects with key-value pairs. This class should not be used within schemas.
|
|
1559
1570
|
|
|
1560
1571
|
:param keys: A field class or instance for dict keys.
|
|
1561
1572
|
:param values: A field class or instance for dict values.
|
|
@@ -1566,6 +1577,9 @@ class Mapping(Field):
|
|
|
1566
1577
|
`keys` and `values` arguments to prevent content validation.
|
|
1567
1578
|
|
|
1568
1579
|
.. versionadded:: 3.0.0rc4
|
|
1580
|
+
.. versionchanged:: 3.24.0
|
|
1581
|
+
`Mapping <marshmallow.fields.Mapping>` should no longer be used as a field within a `Schema <marshmallow.Schema>`.
|
|
1582
|
+
Use `Dict <marshmallow.fields.Dict>` instead.
|
|
1569
1583
|
"""
|
|
1570
1584
|
|
|
1571
1585
|
mapping_type = dict
|
|
@@ -1769,7 +1783,7 @@ class Email(String):
|
|
|
1769
1783
|
class IP(Field):
|
|
1770
1784
|
"""A IP address field.
|
|
1771
1785
|
|
|
1772
|
-
:param
|
|
1786
|
+
:param exploded: If `True`, serialize ipv6 address in long form, ie. with groups
|
|
1773
1787
|
consisting entirely of zeros included.
|
|
1774
1788
|
|
|
1775
1789
|
.. versionadded:: 3.8.0
|
|
@@ -1835,7 +1849,7 @@ class IPInterface(Field):
|
|
|
1835
1849
|
|
|
1836
1850
|
see https://python.readthedocs.io/en/latest/library/ipaddress.html#interface-objects
|
|
1837
1851
|
|
|
1838
|
-
:param
|
|
1852
|
+
:param exploded: If `True`, serialize ipv6 interface in long form, ie. with groups
|
|
1839
1853
|
consisting entirely of zeros included.
|
|
1840
1854
|
"""
|
|
1841
1855
|
|
|
@@ -1886,8 +1900,8 @@ class IPv6Interface(IPInterface):
|
|
|
1886
1900
|
class Enum(Field):
|
|
1887
1901
|
"""An Enum field (de)serializing enum members by symbol (name) or by value.
|
|
1888
1902
|
|
|
1889
|
-
:param enum
|
|
1890
|
-
:param
|
|
1903
|
+
:param enum: Enum class
|
|
1904
|
+
:param by_value: Whether to (de)serialize by value or by name,
|
|
1891
1905
|
or Field class or instance to use to (de)serialize by value. Defaults to False.
|
|
1892
1906
|
|
|
1893
1907
|
If `by_value` is `False` (default), enum members are (de)serialized by symbol (name).
|
|
@@ -1959,10 +1973,10 @@ class Enum(Field):
|
|
|
1959
1973
|
class Method(Field):
|
|
1960
1974
|
"""A field that takes the value returned by a `Schema <marshmallow.Schema>` method.
|
|
1961
1975
|
|
|
1962
|
-
:param
|
|
1976
|
+
:param serialize: The name of the Schema method from which
|
|
1963
1977
|
to retrieve the value. The method must take an argument ``obj``
|
|
1964
1978
|
(in addition to self) that is the object to be serialized.
|
|
1965
|
-
:param
|
|
1979
|
+
:param deserialize: Optional name of the Schema method for deserializing
|
|
1966
1980
|
a value The method must take a single argument ``value``, which is the
|
|
1967
1981
|
value to deserialize.
|
|
1968
1982
|
|
marshmallow/schema.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""The
|
|
1
|
+
"""The `Schema <marshmallow.Schema>` class, including its metaclass and options (class Meta)."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -60,7 +60,7 @@ def _get_fields_by_mro(klass: SchemaMeta):
|
|
|
60
60
|
class itself is excluded from the search; only its parents are checked. Get
|
|
61
61
|
fields from ``_declared_fields`` if available, else use ``__dict__``.
|
|
62
62
|
|
|
63
|
-
:param
|
|
63
|
+
:param klass: Class whose fields to retrieve
|
|
64
64
|
"""
|
|
65
65
|
mro = inspect.getmro(klass)
|
|
66
66
|
# Loop over mro in reverse to maintain correct order of fields
|
|
@@ -191,7 +191,7 @@ class SchemaMeta(ABCMeta):
|
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
class SchemaOpts:
|
|
194
|
-
"""class Meta options for the
|
|
194
|
+
"""class Meta options for the `Schema <marshmallow.Schema>`. Defines defaults."""
|
|
195
195
|
|
|
196
196
|
def __init__(self, meta, ordered: bool = False):
|
|
197
197
|
self.fields = getattr(meta, "fields", ())
|
|
@@ -440,8 +440,9 @@ class Schema(base.SchemaABC, metaclass=SchemaMeta):
|
|
|
440
440
|
Generated schemas are not added to the class registry and therefore cannot
|
|
441
441
|
be referred to by name in `Nested` fields.
|
|
442
442
|
|
|
443
|
-
|
|
444
|
-
:param
|
|
443
|
+
|
|
444
|
+
:param fields: Dictionary mapping field names to field instances.
|
|
445
|
+
:param name: Optional name for the class, which will appear in
|
|
445
446
|
the ``repr`` for the class.
|
|
446
447
|
|
|
447
448
|
.. versionadded:: 3.0.0
|
|
@@ -483,11 +484,11 @@ class Schema(base.SchemaABC, metaclass=SchemaMeta):
|
|
|
483
484
|
def _call_and_store(getter_func, data, *, field_name, error_store, index=None):
|
|
484
485
|
"""Call ``getter_func`` with ``data`` as its argument, and store any `ValidationErrors`.
|
|
485
486
|
|
|
486
|
-
:param
|
|
487
|
+
:param getter_func: Function for getting the serialized/deserialized
|
|
487
488
|
value from ``data``.
|
|
488
489
|
:param data: The data passed to ``getter_func``.
|
|
489
|
-
:param
|
|
490
|
-
:param
|
|
490
|
+
:param field_name: Field name.
|
|
491
|
+
:param index: Index of the item being validated, if validating a collection,
|
|
491
492
|
otherwise `None`.
|
|
492
493
|
"""
|
|
493
494
|
try:
|
|
@@ -503,7 +504,7 @@ class Schema(base.SchemaABC, metaclass=SchemaMeta):
|
|
|
503
504
|
"""Serialize ``obj``.
|
|
504
505
|
|
|
505
506
|
:param obj: The object(s) to serialize.
|
|
506
|
-
:param
|
|
507
|
+
:param many: `True` if ``data`` should be serialized as a collection.
|
|
507
508
|
:return: A dictionary of the serialized data
|
|
508
509
|
"""
|
|
509
510
|
if many and obj is not None:
|
|
@@ -583,16 +584,16 @@ class Schema(base.SchemaABC, metaclass=SchemaMeta):
|
|
|
583
584
|
) -> typing.Any | list[typing.Any]:
|
|
584
585
|
"""Deserialize ``data``.
|
|
585
586
|
|
|
586
|
-
:param
|
|
587
|
-
:param
|
|
588
|
-
:param
|
|
589
|
-
:param
|
|
587
|
+
:param data: The data to deserialize.
|
|
588
|
+
:param error_store: Structure to store errors.
|
|
589
|
+
:param many: `True` if ``data`` should be deserialized as a collection.
|
|
590
|
+
:param partial: Whether to ignore missing fields and not require
|
|
590
591
|
any fields declared. Propagates down to ``Nested`` fields as well. If
|
|
591
592
|
its value is an iterable, only missing fields listed in that iterable
|
|
592
593
|
will be ignored. Use dot delimiters to specify nested fields.
|
|
593
594
|
:param unknown: Whether to exclude, include, or raise an error for unknown
|
|
594
595
|
fields in the data. Use `EXCLUDE`, `INCLUDE` or `RAISE`.
|
|
595
|
-
:param
|
|
596
|
+
:param index: Index of the item being serialized (for storing errors) if
|
|
596
597
|
serializing a collection, otherwise `None`.
|
|
597
598
|
:return: The deserialized data as `dict_class` instance or list of `dict_class`
|
|
598
599
|
instances if `many` is `True`.
|
marshmallow/types.py
CHANGED
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
This module is provisional. Types may be modified, added, and removed between minor releases.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
8
10
|
import typing
|
|
9
11
|
|
|
12
|
+
#: A type that can be either a sequence of strings or a set of strings
|
|
10
13
|
StrSequenceOrSet = typing.Union[typing.Sequence[str], typing.AbstractSet[str]]
|
|
14
|
+
|
|
15
|
+
#: Type for validator functions
|
|
11
16
|
Validator = typing.Callable[[typing.Any], typing.Any]
|
marshmallow/utils.py
CHANGED
|
@@ -18,6 +18,10 @@ from marshmallow.base import FieldABC
|
|
|
18
18
|
from marshmallow.exceptions import FieldInstanceResolutionError
|
|
19
19
|
from marshmallow.warnings import RemovedInMarshmallow4Warning
|
|
20
20
|
|
|
21
|
+
if typing.TYPE_CHECKING:
|
|
22
|
+
from marshmallow.fields import Field
|
|
23
|
+
|
|
24
|
+
|
|
21
25
|
EXCLUDE = "exclude"
|
|
22
26
|
INCLUDE = "include"
|
|
23
27
|
RAISE = "raise"
|
|
@@ -111,7 +115,7 @@ def from_rfc(datestring: str) -> dt.datetime:
|
|
|
111
115
|
def rfcformat(datetime: dt.datetime) -> str:
|
|
112
116
|
"""Return the RFC822-formatted representation of a datetime object.
|
|
113
117
|
|
|
114
|
-
:param datetime
|
|
118
|
+
:param datetime: The datetime.
|
|
115
119
|
"""
|
|
116
120
|
return format_datetime(datetime)
|
|
117
121
|
|
|
@@ -229,7 +233,7 @@ def timestamp_ms(value: dt.datetime) -> float:
|
|
|
229
233
|
def isoformat(datetime: dt.datetime) -> str:
|
|
230
234
|
"""Return the ISO8601-formatted representation of a datetime object.
|
|
231
235
|
|
|
232
|
-
:param datetime
|
|
236
|
+
:param datetime: The datetime.
|
|
233
237
|
"""
|
|
234
238
|
return datetime.isoformat()
|
|
235
239
|
|
|
@@ -347,10 +351,10 @@ def get_func_args(func: typing.Callable) -> list[str]:
|
|
|
347
351
|
return _signature(func)
|
|
348
352
|
|
|
349
353
|
|
|
350
|
-
def resolve_field_instance(cls_or_instance):
|
|
351
|
-
"""Return a
|
|
354
|
+
def resolve_field_instance(cls_or_instance: type[Field] | Field) -> Field:
|
|
355
|
+
"""Return a field instance from a field class or instance.
|
|
352
356
|
|
|
353
|
-
:param
|
|
357
|
+
:param cls_or_instance: Field class or instance.
|
|
354
358
|
"""
|
|
355
359
|
if isinstance(cls_or_instance, type):
|
|
356
360
|
if not issubclass(cls_or_instance, FieldABC):
|
marshmallow/validate.py
CHANGED
|
@@ -637,9 +637,9 @@ class ContainsOnly(OneOf):
|
|
|
637
637
|
in the sequence is also in the sequence passed as ``choices``. Empty input
|
|
638
638
|
is considered valid.
|
|
639
639
|
|
|
640
|
-
:param
|
|
641
|
-
:param
|
|
642
|
-
:param
|
|
640
|
+
:param choices: Same as :class:`OneOf`.
|
|
641
|
+
:param labels: Same as :class:`OneOf`.
|
|
642
|
+
:param error: Same as :class:`OneOf`.
|
|
643
643
|
|
|
644
644
|
.. versionchanged:: 3.0.0b2
|
|
645
645
|
Duplicate values are considered valid.
|
|
@@ -667,8 +667,8 @@ class ContainsNoneOf(NoneOf):
|
|
|
667
667
|
in the sequence is a member of the sequence passed as ``iterable``. Empty input
|
|
668
668
|
is considered valid.
|
|
669
669
|
|
|
670
|
-
:param iterable
|
|
671
|
-
:param
|
|
670
|
+
:param iterable: Same as :class:`NoneOf`.
|
|
671
|
+
:param error: Same as :class:`NoneOf`.
|
|
672
672
|
|
|
673
673
|
.. versionadded:: 3.6.0
|
|
674
674
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: marshmallow
|
|
3
|
-
Version: 3.25.
|
|
3
|
+
Version: 3.25.1
|
|
4
4
|
Summary: A lightweight library for converting complex datatypes to and from native Python datatypes.
|
|
5
5
|
Author-email: Steven Loria <sloria1@gmail.com>
|
|
6
6
|
Maintainer-email: Steven Loria <sloria1@gmail.com>, Jérôme Lafréchoux <jerome@jolimont.fr>, Jared Deckard <jared@shademaps.com>
|
|
@@ -19,10 +19,12 @@ Requires-Dist: packaging>=17.0
|
|
|
19
19
|
Requires-Dist: marshmallow[tests] ; extra == "dev"
|
|
20
20
|
Requires-Dist: tox ; extra == "dev"
|
|
21
21
|
Requires-Dist: pre-commit>=3.5,<5.0 ; extra == "dev"
|
|
22
|
-
Requires-Dist: sphinx==8.1.3 ; extra == "docs"
|
|
23
|
-
Requires-Dist: sphinx-issues==5.0.0 ; extra == "docs"
|
|
24
|
-
Requires-Dist: alabaster==1.0.0 ; extra == "docs"
|
|
25
22
|
Requires-Dist: autodocsumm==0.2.14 ; extra == "docs"
|
|
23
|
+
Requires-Dist: furo==2024.8.6 ; extra == "docs"
|
|
24
|
+
Requires-Dist: sphinx-copybutton==0.5.2 ; extra == "docs"
|
|
25
|
+
Requires-Dist: sphinx-issues==5.0.0 ; extra == "docs"
|
|
26
|
+
Requires-Dist: sphinx==8.1.3 ; extra == "docs"
|
|
27
|
+
Requires-Dist: sphinxext-opengraph==0.9.1 ; extra == "docs"
|
|
26
28
|
Requires-Dist: pytest ; extra == "tests"
|
|
27
29
|
Requires-Dist: simplejson ; extra == "tests"
|
|
28
30
|
Project-URL: Changelog, https://marshmallow.readthedocs.io/en/latest/changelog.html
|
|
@@ -56,6 +58,8 @@ marshmallow: simplified object serialization
|
|
|
56
58
|
:target: https://marshmallow.readthedocs.io/
|
|
57
59
|
:alt: Documentation
|
|
58
60
|
|
|
61
|
+
.. start elevator-pitch
|
|
62
|
+
|
|
59
63
|
**marshmallow** is an ORM/ODM/framework-agnostic library for converting complex datatypes, such as objects, to and from native Python datatypes.
|
|
60
64
|
|
|
61
65
|
.. code-block:: python
|
|
@@ -86,20 +90,21 @@ marshmallow: simplified object serialization
|
|
|
86
90
|
# 'release_date': '1971-12-17',
|
|
87
91
|
# 'title': 'Hunky Dory'}
|
|
88
92
|
|
|
89
|
-
|
|
90
93
|
In short, marshmallow schemas can be used to:
|
|
91
94
|
|
|
92
95
|
- **Validate** input data.
|
|
93
96
|
- **Deserialize** input data to app-level objects.
|
|
94
97
|
- **Serialize** app-level objects to primitive Python types. The serialized objects can then be rendered to standard formats such as JSON for use in an HTTP API.
|
|
95
98
|
|
|
96
|
-
Get
|
|
99
|
+
Get it now
|
|
97
100
|
==========
|
|
98
101
|
|
|
99
|
-
::
|
|
102
|
+
.. code-block:: shell-session
|
|
100
103
|
|
|
101
104
|
$ pip install -U marshmallow
|
|
102
105
|
|
|
106
|
+
.. end elevator-pitch
|
|
107
|
+
|
|
103
108
|
Documentation
|
|
104
109
|
=============
|
|
105
110
|
|
|
@@ -146,6 +151,8 @@ Thank you to all our backers! [`Become a backer`_]
|
|
|
146
151
|
Sponsors
|
|
147
152
|
--------
|
|
148
153
|
|
|
154
|
+
.. start sponsors
|
|
155
|
+
|
|
149
156
|
marshmallow is sponsored by `Route4Me <https://route4me.com>`_.
|
|
150
157
|
|
|
151
158
|
.. image:: https://github.com/user-attachments/assets/018c2e23-032e-4a11-98da-8b6dc25b9054
|
|
@@ -157,6 +164,8 @@ Your logo will be displayed here with a link to your website. [`Become a sponsor
|
|
|
157
164
|
|
|
158
165
|
.. _`Become a sponsor`: https://opencollective.com/marshmallow#sponsor
|
|
159
166
|
|
|
167
|
+
.. end sponsors
|
|
168
|
+
|
|
160
169
|
Professional Support
|
|
161
170
|
====================
|
|
162
171
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
marshmallow/__init__.py,sha256=C-zbaQJ9dlJLJxotIqTa5OOaD6ojGNRqW8moGrMsGr8,2387
|
|
2
|
+
marshmallow/base.py,sha256=39W78-rnuzzx5T95YWBEECzjtqxdUA8XzYJNHd39VLg,1362
|
|
3
|
+
marshmallow/class_registry.py,sha256=JaA2tJo53ZNzTVoJM_MuN_WKaadEskIcxjOrLKy76iQ,3015
|
|
4
|
+
marshmallow/decorators.py,sha256=3U7gLAmiotqoVC8O2j_7kwUS2ceoJUdkAcuk8SuH9oQ,8486
|
|
5
|
+
marshmallow/error_store.py,sha256=A7AxgLMw9ffSmaxRH4x3wcBWibx-DuGH4LwSDpVn50I,2223
|
|
6
|
+
marshmallow/exceptions.py,sha256=DuARdOcirCdJxmlp16V97hQKAXOokvdW12jXtYOlGyk,2326
|
|
7
|
+
marshmallow/fields.py,sha256=WgtoWGZR3WLkqEf056NTUlHurLVlfCho3TQQ5zSlMqc,74688
|
|
8
|
+
marshmallow/orderedset.py,sha256=C2aAG6w1faIL1phinbAltbe3AUAnF5MN6n7fzESNDhI,2922
|
|
9
|
+
marshmallow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
marshmallow/schema.py,sha256=w81gPdm9L4_NaloLb8Z04U5shzUbuDOtDPeJL8uMHH0,48653
|
|
11
|
+
marshmallow/types.py,sha256=csTzHJh-tbNs9t9eDRG6HjJMNawSVNw27mmor6w4ztM,423
|
|
12
|
+
marshmallow/utils.py,sha256=Xvpd7h3IdB8tRKfa-u95DbOXjLgDzWRNJIwjsTNI9n0,11970
|
|
13
|
+
marshmallow/validate.py,sha256=D9CbPe2vywalBcTa3iuwCqIK6mNhDn5pQaJ_kn_6_y4,24116
|
|
14
|
+
marshmallow/warnings.py,sha256=YHC0kQQBbTKCiA1FuwnbnXqrph7oKuU9BjTV4cxwnzE,192
|
|
15
|
+
marshmallow-3.25.1.dist-info/LICENSE,sha256=kGtdkFHkJhRMsXOtkRZnuOvQWpxYTCwmwTWzKj7RIAE,1064
|
|
16
|
+
marshmallow-3.25.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
|
17
|
+
marshmallow-3.25.1.dist-info/METADATA,sha256=aBxXuzqfK0y4iUwJb9zVGHq9vcndAyUzCRZRVVTLmf8,7310
|
|
18
|
+
marshmallow-3.25.1.dist-info/RECORD,,
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
marshmallow/__init__.py,sha256=C-zbaQJ9dlJLJxotIqTa5OOaD6ojGNRqW8moGrMsGr8,2387
|
|
2
|
-
marshmallow/base.py,sha256=39W78-rnuzzx5T95YWBEECzjtqxdUA8XzYJNHd39VLg,1362
|
|
3
|
-
marshmallow/class_registry.py,sha256=ZULbtwFxnj4bbzQqfwTLyNPUpr6xAZTLFMar4YJfKJQ,3032
|
|
4
|
-
marshmallow/decorators.py,sha256=B8Z-PsxWrftY4jTq3y_wt7kwlJWQI2vVQQyApMY5IeQ,8490
|
|
5
|
-
marshmallow/error_store.py,sha256=A7AxgLMw9ffSmaxRH4x3wcBWibx-DuGH4LwSDpVn50I,2223
|
|
6
|
-
marshmallow/exceptions.py,sha256=DuARdOcirCdJxmlp16V97hQKAXOokvdW12jXtYOlGyk,2326
|
|
7
|
-
marshmallow/fields.py,sha256=Z8wS9If4tqcv0KFnbm7HS5csMiVOD6--Donv6FlMfOc,74082
|
|
8
|
-
marshmallow/orderedset.py,sha256=C2aAG6w1faIL1phinbAltbe3AUAnF5MN6n7fzESNDhI,2922
|
|
9
|
-
marshmallow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
marshmallow/schema.py,sha256=qUY1MvcYxtEuztzjoom2fYaC7x2t16cAx4FBdgz3SDY,48696
|
|
11
|
-
marshmallow/types.py,sha256=RDS4IfasIehvH2rGWh9e4RTBtsMp-JFFtjApajV22zc,283
|
|
12
|
-
marshmallow/utils.py,sha256=pLZXqQWu7PHaQrQCrgwnR8eI_-aq_BVct5CCwyygUvk,11917
|
|
13
|
-
marshmallow/validate.py,sha256=t5-4Qg_XlSQgcCujf_pimKIdZE0QT63jHyQP-miJNK0,24151
|
|
14
|
-
marshmallow/warnings.py,sha256=YHC0kQQBbTKCiA1FuwnbnXqrph7oKuU9BjTV4cxwnzE,192
|
|
15
|
-
marshmallow-3.25.0.dist-info/LICENSE,sha256=kGtdkFHkJhRMsXOtkRZnuOvQWpxYTCwmwTWzKj7RIAE,1064
|
|
16
|
-
marshmallow-3.25.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
|
17
|
-
marshmallow-3.25.0.dist-info/METADATA,sha256=yQLETlmBAzADnSDY4fAT_4zsyjlAxPlRFT6NVIovaYo,7084
|
|
18
|
-
marshmallow-3.25.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|