Marshmallow Objects and Models
Project description
marshmallow-objects
Marshmallow Objects and Models
Serializing/Deserializing Python objects using Marshmallow library.
import marshmallow_objects as marshmallow
class Artist(marshmallow.Model):
name = marshmallow.fields.Str()
class Album(marshmallow.Model):
title = marshmallow.fields.Str()
release_date = marshmallow.fields.Date()
artist = marshmallow.NestedModel(Artist)
bowie_raw = dict(name='David Bowie')
album_raw = dict(artist=bowie_raw, title='Hunky Dory',
release_date='1971-12-17')
album = Album(**album_raw)
print(album.title)
print(album.release_date)
print(album.artist.name)
# Hunky Dory
# 1971-12-17
# David Bowie
Get It Now
$ pip install -U marshmallow-objects
Project Links
License
MIT licensed. See the bundled LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
marshmallow-objects-1.0.18.tar.gz
(10.9 kB
view hashes)
Built Distribution
Close
Hashes for marshmallow-objects-1.0.18.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 963e88216b3f62f15879950f1224b89712d727549b9afdb5546cceac10b370a7 |
|
MD5 | 2ffd33de0c6c24aecb9eceae3204e1c2 |
|
BLAKE2b-256 | 76a073207bdecffecabcc11f1b25336b977143fb8b77e3dbc33edc75c4840bed |
Close
Hashes for marshmallow_objects-1.0.18-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cc0fcf940d1cfeca79a5d726196c56e49e748fcde5713c921c76b3ee84d8e94 |
|
MD5 | c69e16cbb2fc817375978bc175693c99 |
|
BLAKE2b-256 | 01c623b5bf329c2df9624dc816126986c02100dbaf619d0f36600688e86f07fe |