Decorator for `marshmallow.Schema` to sort fields in needed order while dumping
Project description
marshmallow-dumped-order
Decorator for marshmallow.Schema
to sort fields
in needed order while dumping (python36+).
from marshmallow import Schema, fields
from marshmallow_dumped_order import dumped_order
@dumped_order("name", "age")
class User(Schema):
age = fields.Int()
name = fields.String()
dumped = User().dumps({"age": 356, "name": "Jarvis"})
assert dumped.data == '{"name": "Jarvis", "age": 356}'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for marshmallow-dumped-order-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf4aa174ba033d3b3d23a1f10405ea39ea95cf0ff9b41b2bba7b2b542376cf89 |
|
MD5 | 0e2a87101983b9a0524a70fa05e15523 |
|
BLAKE2b-256 | 7c8e965189c5038320c2ab40e050967a62a4bb32d729eb0a1c568a93d2c74d89 |