Skip to main content

Marshmallow Objects and Models

Project description

marshmallow-objects

Test Codecov Version Black

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


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-2.3.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

marshmallow_objects-2.3.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file marshmallow-objects-2.3.0.tar.gz.

File metadata

  • Download URL: marshmallow-objects-2.3.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for marshmallow-objects-2.3.0.tar.gz
Algorithm Hash digest
SHA256 b2652695375f1637a06cbaef3f4d6d1ab096c3bb7c0450d0bbce84f114776021
MD5 c1571da0abd816c18011f1a4d49e0d62
BLAKE2b-256 c8d36d045a7d0436ede60ce7328a1a261b0c517dc36c49a6785559f3e43bb7f8

See more details on using hashes here.

File details

Details for the file marshmallow_objects-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: marshmallow_objects-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for marshmallow_objects-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 194872176f821605444da038f759a09d1cb60e0e3562f7dcb85ee502294cec94
MD5 161392d497203cb25baffa1133426698
BLAKE2b-256 2186980ff71e08c27390c155f92561d2640cc3a44fa33ecff4e450cda8eeb1fd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page