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
marshmallow-objects-1.0.16.tar.gz
(10.9 kB
view hashes)
Built Distribution
Close
Hashes for marshmallow-objects-1.0.16.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ddcfd7fc242d73627e791b417120fb23ce0a7df18e0e4e08068cccd6854b2c5 |
|
MD5 | 16950f0c04f7624455546c686f0efbfa |
|
BLAKE2b-256 | 5d2d793e8c2745d5b52b1584ce6f71faa5c31649c7ecf78655712c6b2d776feb |
Close
Hashes for marshmallow_objects-1.0.16-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02a3fe7b3aa5b1de41ab209f976495456523dadd7d674ba63bb93368bd8dedd0 |
|
MD5 | 635b3e975fb4f5c8d157a3c1244933df |
|
BLAKE2b-256 | 79b09dbd7fba3c26ab22b544cd6489ae4e08e5898e4995c686dc6c821fcfede5 |