Convert json to object and back in Python.
Project description
JSONClass
Convert json to object and back in Python.
Example
from jsonclass import JSONClass
class Test(JSONClass):
field: str
obj = Test()
obj.field = "value"
assert obj.to_json()["field"] == "value"
obj = JSONClass({"__json_class__": "Test", "field": "value2"})
assert isinstance(obj, Test)
assert obj.field = "value2"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jsonclass-0.0.6.tar.gz
(15.4 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
jsonclass-0.0.6-py3-none-any.whl
(14.2 kB
view details)
File details
Details for the file jsonclass-0.0.6.tar.gz.
File metadata
- Download URL: jsonclass-0.0.6.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adbfab945bfd63764d094cc499f078b57ce546649be2ed86d967ceebfd244a2b
|
|
| MD5 |
735734ed2855b929c445193e3aba917e
|
|
| BLAKE2b-256 |
0d0d1f3f6cc0b167bda386ca1e3575af3d2509e107ffebbf0e0bd27aa40063c7
|
File details
Details for the file jsonclass-0.0.6-py3-none-any.whl.
File metadata
- Download URL: jsonclass-0.0.6-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1d7e730b9572594c538029710e060f34b9f78a34cf57d0b75c5f997d8b694dc
|
|
| MD5 |
0ebfe6e4ea093477171a1bb4ea71ac7e
|
|
| BLAKE2b-256 |
64a06456fd517bfc18b9bb87df81136e30ef6545a8fd60b65391004385052269
|