Skip to main content

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

Project description

marshmallow-dumped-order

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 dumped.data == '{"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 and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page