Skip to main content

Decorator for `marshmallow.Schema` to sort fields in needed order while dumping

Project description


PyPI version Build Status codecov

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 == '{"name": "Jarvis", "age": 356}'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marshmallow-dumped-order-1.1.0.tar.gz (2.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page