Skip to main content

Marshmallow advanced Python library

Extra fields

Active field

Converts active field to state and back.

>>> class SimpleSchema(Schema):
        active = Active()

>>> SimpleSchema().dump({'state': 'active'})
{'active': True})
>>> SimpleSchema().dump({'state': 'inactive'})
{'active': False}

>>> SimpleSchema().load({'active': True})
{'state': 'active'}
>>> SimpleSchema().load({'active': False})
{'state': 'inactive'}

Filter by query parameter:

>>> class SimpleFilterSchema(Schema):
        active = Active(as_filter=True)

>>> SimpleFilterSchema().load({'active': 'true'})
{'state': 'active'}
>>> SimpleFilterSchema().load({'active': 'false'})
{'state': 'inactive'}
>>> SimpleFilterSchema().load({})
{'state__ne': 'deleted'}

For experienced usage try positives, negatives, positive_filter, negative_filter, missing_filter parameters. You can see behaviour for this parameters in tests.

Release files for marshmallow-advanced 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for marshmallow-advanced 1.2.0
File Size Uploaded
marshmallow_advanced-1.2.0.tar.gz 6.8 kB Details

Release files / marshmallow_advanced-1.2.0.tar.gz

Download URL marshmallow_advanced-1.2.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ae75b02de042571e0393f23fed11fa60713fcb7f4f99e035c36049e79262f835
BLAKE2b-256 checksum
How to use checksums
69a3f138de5fb4dc84b2850ca876e7edab2fed24c8fc342f857149ad13b7058c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

1.2.0 This release

1 release file

1.1.9

1 release file

1.1.8

1 release file

1.1.7

1 release file

1.1.6

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page