Overview
Union fields for marshmallow.
Free software: MIT license
Warning
This library works by trying a list of fields one by one, and (de)serializing with the first one not to raise an error. The type of the values is not taken into account, so if one of the fields in the union accepts values of an unexpected type, they will be used for serialization. This can lead to a surprising behavior, because :
u = Union(fields=[fields.Integer(), fields.String()]) # the Integer field accepts string representations of integers type(u.deserialize('0')) # -> intIf you want to have precise control of which field will be used for which value, you can use marshmallow-polyfield instead of this library.
Documentation
https://python-marshmallow-union.readthedocs.io/
0.1.15 (2020-05-30)
Changes
Fix #32 : Never ignore the value passed to _serialize. Notably, this fixes the serialization of lists of unions, such as List(Union([Int(), String()]))
0.1.12 (2019-10-24)
Backward-incompatible Changes
On serialization, marshmallow_union.ExceptionGroup is raised if all candidate fields fail. #24
0.1.11 (2019-06-19)
Changes
Override the underscore-prefixed methods instead of the plain ones #22
Changelog
0.1.10 (2019-06-08)
Changes
Use Towncrier for changelog. #18
0.1.0 (2019-06-07)
First release on PyPI.
Metadata
Release files for marshmallow-union 0.1.15.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| marshmallow-union-0.1.15.post1.tar.gz | 17.5 kB | Without provenance | Details for marshmallow-union-0.1.15.post1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| marshmallow_union-0.1.15.post1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for marshmallow_union-0.1.15.post1-py2.py3-none-any.whl |
Total release size: 22.2 kB
Release files / marshmallow-union-0.1.15.post1.tar.gz
| Download URL | marshmallow-union-0.1.15.post1.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c08f0a87891ae73dd2b5d4a154bc7daea20c3bc0f99ca0b6a26570c927d20c8c
|
|
BLAKE2b-256 checksum How to use checksums |
f4b33b2adcebc922d147637e18866bbce107dc3c0938e715c003697bbab2e9bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.3
|
Release files / marshmallow_union-0.1.15.post1-py2.py3-none-any.whl
| Download URL | marshmallow_union-0.1.15.post1-py2.py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
1e21b759c76735305f99179c1a16759ebb9629733159628241b3f2117ff55e86
|
|
BLAKE2b-256 checksum How to use checksums |
6db71f3c4575b488435c91c7bf25598ea6d22ae09b55cf1724320f4bd451323d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.7.3
|
Security for marshmallow-union 0.1.15.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.