quick and dirty way to convert json string to python object
Project description
qjson
=====
quick and dirty way to convert json string to python object.
# install
`$pip install qjson`
or
just copy the qjson/qjson.py to your project.
#usage
```python
import qjson
json_str = '{"person":\
{"name":"jerry", "age":32, "web":{"url":"http://jatsz.org", "desc":"blog"}}, \
"grade": "a", "score":[80,90]}'
info = qjson.loads(json_str)
assert info.person.name == "jerry"
assert info.grade == "a"
assert info.score == [80, 90]
```
-0.1.8:
fix array as top element, which also has object within it.
-0.1.8:
supporting array has object as element.
=====
quick and dirty way to convert json string to python object.
# install
`$pip install qjson`
or
just copy the qjson/qjson.py to your project.
#usage
```python
import qjson
json_str = '{"person":\
{"name":"jerry", "age":32, "web":{"url":"http://jatsz.org", "desc":"blog"}}, \
"grade": "a", "score":[80,90]}'
info = qjson.loads(json_str)
assert info.person.name == "jerry"
assert info.grade == "a"
assert info.score == [80, 90]
```
-0.1.8:
fix array as top element, which also has object within it.
-0.1.8:
supporting array has object as element.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qjson-0.1.9.tar.gz
(2.3 kB
view details)
File details
Details for the file qjson-0.1.9.tar.gz.
File metadata
- Download URL: qjson-0.1.9.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c9e0cd1c7d360508253940f1dbb5375a7b7318a835fde7ab5298db4c1e452bf
|
|
| MD5 |
ee282ae97e62c96e3bc2fd9e12b444f7
|
|
| BLAKE2b-256 |
fb16ed4204e94755d027f2e0bbc7af74a3997b1a382c59a9efcfc6bc5f58b2a6
|