marshmallow
marshmallow copied to clipboard
A lightweight library for converting complex objects to and from simple Python datatypes.
Since `datetime.datetime.strftime` doesn't have an easy way to convert a datetime with microsecond precision to millisecond precision this also leaks into Marshmallow. I have come up with ``` from marshmallow...
fields.Method is pretty much always used to return a certain type of value. It doesn't allow to choose options for the return value though. For example, if one designes a...
In order to iterate over a schema's fields in the order in which it was defined, you have to add a `class Meta: ordered=True`. ``` from marshmallow import Schema, fields...
Is it possible to add an attribute by default to a Marshmallow schema? For instance, I would like to create a deserialisation only schema. That would imply adding ```load_only``` to...
The URL validator does not check an internet address correctly. A port of an internet address has to be a 16-bit number. One of four numbers of IPv4 has to...
This PR adds the possibility to load and dump to timestamps. This was discussed before in issue #612 and then partly implemented in #1003. Since the branch was stale (still...
Replaces @orenc17's #1885. This is a long standing feature request. See for instance discussions in #267. The status quo is that people can use @justanr's [marshmallow_enum](https://github.com/justanr/marshmallow_enum). Currently, this lib doesn't...
This merge request adds a type hint to `fields.Email`'s `__init__ method to avoid no untyped call errors in mypy for library consumers.
If you want to create a field that transforms `None` to a preset value, a custom field is required. Currently the documentation for "Creating A Field Class" states: > To...
I'm just getting started with marshmallow so if there's a more elegant way to solve the issue please let me know. I have the following simple model and schema. ```python...