_
  (_)
   _ ___  ___  _ __  ___
  | / __|/ _ \| '_ \/ __|
  | \__ | (_) | | | \__ \
  | |___/\___/|_| |_|___/
 _/ | JSON SERIALIZATION
|__/      MADE EASY!

  Official Documentation

PyPI version Code Coverage Scrutinizer Code Quality

~ Any Python objects to/from JSON, easily! ~

Jsons is a library that allows you to serialize your plain old Python objects to readable json (dicts or strings) and deserialize them back. No magic, no special types, no polluting your objects. Just you, Python and clean json.

Search Page

Features

  • Python 3.5+
  • Minimal effort to use!
  • No magic, just you, Python and jsons!
  • Human readible JSON without pollution!
  • Easily customizable and extendable!
  • Type hints for the win!

Installing and using

Install with pip:

pip install jsons

And then you’re ready to go:

import jsons

@dataclass
class Car:
    color: str
    owner: str

dumped = jsons.dump(Car('red', 'Guido'))

The value of dumped:

{'color': 'red', 'owner': 'Guido'}

And to deserialize, just do:

instance = jsons.load(loaded, Car)

Type hints for the win!