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([
Car
])
Serialization
string = serializer.serialize(car) # sting contains next json:
# {
# "mark": "Ford",
# "model": "Mustang",
# "year": 2016,
# "color": "Black"
# }
Deserialization
car = serializer.deserialize(string)
Variable car type of Car and contains values of all fields.
Enjoy!
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
json_serializer-1.0.1.tar.gz
(2.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file json_serializer-1.0.1.tar.gz.
File metadata
- Download URL: json_serializer-1.0.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
107b370c2b902066777d81f16a8b9576e4a9f921dc3848ae89c2af69545a77d5
|
|
| MD5 |
b2c56c5447085d9d8c1a8ae915473e2d
|
|
| BLAKE2b-256 |
d05cf3325bfbea46d836bd66d7bbd2caae8ae9fb1401c92edf338bb7a01b214e
|
File details
Details for the file json_serializer-1.0.1-py3-none-any.whl.
File metadata
- Download URL: json_serializer-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c88851ac86399b608ecf5393607eb7e987808a7eccfc117274054c74c607a924
|
|
| MD5 |
3dad9776126bc115d5f6103271566db7
|
|
| BLAKE2b-256 |
c59ba387f5698d17d8f0134def12d3eac3f8f63dd2f49722f5d5b177e46ad6d5
|