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 details)

Uploaded Source

File details

Details for the file marshmallow-dumped-order-1.1.0.tar.gz.

File metadata

  • Download URL: marshmallow-dumped-order-1.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for marshmallow-dumped-order-1.1.0.tar.gz
Algorithm Hash digest
SHA256 595471d639730f621de2d75b05c6f0ccd7240e60fdbd1c03a34a70eaba939afb
MD5 8dea883bac47d4b94cdabee8d1c83ca8
BLAKE2b-256 fe81d5be89fbdbe2a4aebcbf29f5877e7a253f67e72a61e805e9c66bb913108a

See more details on using hashes here.

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