Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

JSON de/serializers

Project description


PyPI Version CI Documentation Status

JSON de/serializer for Python, inspired by attrs and SQLAlchemy.


import requests
from json_serde import JsonSerde, Integer, String, IsoDateTime

class User(JsonSerde):
    username = String()
    user_id = Integer(rename='userId')
    birthday = IsoDateTime(is_optional=True, default=None)

resp = requests.get('')

api_response = resp.json()
# {'username': 'emmag', 'userId': 1312, 'somethingElse': ['irrelevant']}

user = User.from_json(api_response)
assert user.username == 'emmag'
assert isinstance(user.user_id, int)
assert user.birthday is None


This work is dual licensed under the MIT and Apache-2.0 licenses. See LICENSE-MIT and LICENSE-APACHE for details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for json-serde, version 0.0.10
Filename, size File type Python version Upload date Hashes
Filename, size json_serde-0.0.10-py3-none-any.whl (11.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size json-serde-0.0.10.tar.gz (10.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page