Marshmallow Objects and Models
Project description
marshmallow-objects
===================
[![Build Status](https://travis-ci.org/SVilgelm/marshmallow-objects.svg?branch=master)](https://travis-ci.org/SVilgelm/marshmallow-objects)
[![codecov](https://codecov.io/gh/SVilgelm/marshmallow-objects/branch/master/graph/badge.svg)](https://codecov.io/gh/SVilgelm/marshmallow-objects)
[![PyPI version](https://badge.fury.io/py/marshmallow-objects.svg)](https://badge.fury.io/py/marshmallow-objects)
**Marshmallow Objects and Models**
Serializing/Deserializing Python objects using [Marshmallow](https://github.com/marshmallow-code/marshmallow) library.
```python
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
----------
```bash
$ pip install -U marshmallow-objects
```
Project Links
-------------
* [Marshmallow](https://github.com/marshmallow-code/marshmallow)
* [PyPi](https://pypi.python.org/pypi/marshmallow-objects)
* [Cookbook](https://github.com/SVilgelm/marshmallow-objects/wiki)
License
-------
MIT licensed. See the bundled [LICENSE](LICENSE) file for more details.
===================
[![Build Status](https://travis-ci.org/SVilgelm/marshmallow-objects.svg?branch=master)](https://travis-ci.org/SVilgelm/marshmallow-objects)
[![codecov](https://codecov.io/gh/SVilgelm/marshmallow-objects/branch/master/graph/badge.svg)](https://codecov.io/gh/SVilgelm/marshmallow-objects)
[![PyPI version](https://badge.fury.io/py/marshmallow-objects.svg)](https://badge.fury.io/py/marshmallow-objects)
**Marshmallow Objects and Models**
Serializing/Deserializing Python objects using [Marshmallow](https://github.com/marshmallow-code/marshmallow) library.
```python
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
----------
```bash
$ pip install -U marshmallow-objects
```
Project Links
-------------
* [Marshmallow](https://github.com/marshmallow-code/marshmallow)
* [PyPi](https://pypi.python.org/pypi/marshmallow-objects)
* [Cookbook](https://github.com/SVilgelm/marshmallow-objects/wiki)
License
-------
MIT licensed. See the bundled [LICENSE](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
Built Distribution
Close
Hashes for marshmallow-objects-1.0.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46450d1137e55de0f40f325aa1ade780df7c170c70f472a9494e5d863631efc3 |
|
MD5 | 2dba63e5a258d4de3e7a7072a9f08bde |
|
BLAKE2b-256 | bbe8f361cad45a3e03f2757439f0923a0868fd4e15f6bc3466cf1ea21f0409da |
Close
Hashes for marshmallow_objects-1.0.14-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74f6ebb7c2f0af58704efaded8423b27f30bf6bad44a9f45283bb347a64929d3 |
|
MD5 | e7b4994a2767a931d0564bab9b83dd8e |
|
BLAKE2b-256 | 2a46710e3383d1216f1f066ee16da24d144c04c2d3180bdd962f08194f123849 |