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!
Metadata
Release files for json-serializer 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| json_serializer-1.0.1.tar.gz | 2.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| json_serializer-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 kB
Release files / json_serializer-1.0.1.tar.gz
| Download URL | json_serializer-1.0.1.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
107b370c2b902066777d81f16a8b9576e4a9f921dc3848ae89c2af69545a77d5
|
|
BLAKE2b-256 checksum How to use checksums |
d05cf3325bfbea46d836bd66d7bbd2caae8ae9fb1401c92edf338bb7a01b214e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / json_serializer-1.0.1-py3-none-any.whl
| Download URL | json_serializer-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c88851ac86399b608ecf5393607eb7e987808a7eccfc117274054c74c607a924
|
|
BLAKE2b-256 checksum How to use checksums |
c59ba387f5698d17d8f0134def12d3eac3f8f63dd2f49722f5d5b177e46ad6d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|