Skip to main content

Define, serialize, deserialize, and validate Python data structures.

Project description

PyPI Version Documentation Status Build Status Code Coverage

Serde is a lightweight, general-purpose, powerful ORM framework for defining, serializing, deserializing, and validating data structures in Python.

Getting started

Install this package with

pip install serde

Example usage

Define your data structures in a clean and obvious way.

>>> from serde import Model, fields

>>> class Dog(Model):
...     name = fields.Str()
...     hates_cats = fields.Optional(fields.Bool, default=True)

>>> class Owner(Model):
...     name = fields.Str()
...     birthday = fields.Date()
...     dog = fields.Nested(Dog)

Easily serialize and deserialize arbitrary data to and from Python objects.

>>> owner = Owner.from_json('''{
...     "name": "Paris Hilton",
...     "birthday": "1981-02-17",
...     "dog": {"name": "Tinkerbell"}
... }''')

>>> owner.name
'Paris Hilton'
>>> owner.birthday
datetime.date(1981, 2, 17)
>>> owner.dog
Dog(name='Tinkerbell', hates_cats=True)

View the latest usage and API documentation here.

License

This project is licensed under the MIT License.

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

serde-0.6.2.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

serde-0.6.2-py2.py3-none-any.whl (24.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file serde-0.6.2.tar.gz.

File metadata

  • Download URL: serde-0.6.2.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for serde-0.6.2.tar.gz
Algorithm Hash digest
SHA256 8aa308e93004cd98cd9cfffd619bfbe0585e5cfab02bfa6da10a1ebf518d943d
MD5 aa1c704183c85a0393c38be3bf5e39d7
BLAKE2b-256 28b42aa5c0fe876a0c435f3698749e8df9bad529e0a8c882d9da33ecbde5739d

See more details on using hashes here.

File details

Details for the file serde-0.6.2-py2.py3-none-any.whl.

File metadata

  • Download URL: serde-0.6.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for serde-0.6.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 065b0742e8bf5fc517c8fe93864ab5d46b6c3b8c726a5c6826b56464ee1903ea
MD5 d49b97bd76485bf0c6ff9df19048de35
BLAKE2b-256 9e2989e92e533a3a9d22efbf6663006ba1fab24e722b345ba095668faa3df65a

See more details on using hashes here.

Supported by

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