Skip to main content

The library for serialize/deserialize into format JSON.

Project description

Package json_serializer

The library for serialize/deserialize into format JSON.

How use it?

For example you have class that needed serialize or deserialize.
class Car(object):
    mark = None
    model = None
    year = None
    color = None
Create object
car = Car()
car.mark = 'Ford'
car.model = 'Mustang'
car.year = 2016
car.color = 'Black'
Import class JsonSerializer and create object of serializer

In the constructor pass list of classes that will be involved in serialization/deserialization.

from json_serializer.Serializer import Serializer
serializer = Serializer([
string = serializer.serialize(car)      # sting contains next json:
                                        # {
                                        #    "mark": "Ford",
                                        #    "model": "Mustang",
                                        #    "year": 2016,
                                        #    "color": "Black"
                                        # }
car = serializer.deserialize(string)

Variable car type of Car and contains values of all fields.


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-serializer, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size json_serializer-1.0.1-py3-none-any.whl (3.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size json_serializer-1.0.1.tar.gz (2.7 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