convert json|dict to python object
Project description
Pyonize
convert json|dict to python object
Setup
pip install pyonize
Examples
from pyonize import pyonize
deneme = pyonize({"id": 1, "name": "jhon", "job": {"id": 1, "title": "CTO"}, "list": [
1, 2, 3], "dictlist": [{"name": "foo"}, {"name": "bar"}]})
print(deneme.name)
print(deneme.job)
print(deneme.job.title)
from pyonize import Pyon
class Foo(Pyon):
def bar(self):
...
data = {"id": 1, "name": "jhon", "job": {"id": 1, "title": "CTO"},
"list": [1, 2, 3], "dictlist": [{"name": "foo"}, {"name": "bar"}]}
foo = Foo(data)
print(foo.id)
print(foo.dictlist[1].name)
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
pyonize-0.1.5.tar.gz
(2.8 kB
view details)
Built Distribution
File details
Details for the file pyonize-0.1.5.tar.gz
.
File metadata
- Download URL: pyonize-0.1.5.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.10.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7327d5bb3c308129e095f334b9a5ea78d9327320de71fdbf6dc34d07ade6f679 |
|
MD5 | de1d3490426a8c690df2d5a1b7521b11 |
|
BLAKE2b-256 | 95570cb0c16057cfc9243dd94f2d006db055e6fee9f4cc9d9d06a2a47eb81c48 |
File details
Details for the file pyonize-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: pyonize-0.1.5-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.10.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e2e9865665ce7941348271a5b45f5dba106af129ffe17674a0ee0071d43211c |
|
MD5 | 4cf38068bdfcbc1aa5983477e39e5845 |
|
BLAKE2b-256 | a632201f7fd80d28be743ada6319f48956d54cdd3c6eb410f77fa047fc83f4dc |