Json package
Project description
Json Uts
Installation
pip install jsonUts
GitHub
https://github.com/ZdekPyPi/JsonUts
Usage
Json sample
my_json = {
"person":{
"name":"json uts",
"age": 30
},
"my cars":[
{"pattern":"Ferrari","year":2015},
{"pattern":"Lamborghini","year":2018}
],
"job":"Software developer",
"UpperCase":123,
"with space":"lets go!"
}
simple transform
from jsonUts import jsonToObj
jsonO = jsonToObj(my_json)
#jsonO = jsonToObj(my_json,toLower=True) # to convert all keys in lower case.
#jsonO = jsonToObj(my_json,trim_keys=True) # remove white spaces from the start and end
print(jsonO.person.name)
print(jsonO.job)
print(jsonO.with_space)
print(jsonO.my_cars[0].pattern)
Reverse
#After creating you object (jsonO), you can use it
json_again = jsonO.toJson()
json_again_original = jsonO.toJson(original_keys=True) # if you want your original key names back
'2022-05-25'
Change Log
0.0.1 (2024-04-19)
- First Release
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
jsonUts-1.0.3.tar.gz
(3.9 kB
view details)
File details
Details for the file jsonUts-1.0.3.tar.gz
.
File metadata
- Download URL: jsonUts-1.0.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 786e766bb6cfe5a2a5a6cd2db4ec474da09e1e3f2215440885da9c4a9e8335c3 |
|
MD5 | e99a9bec85c818cb06de860f5e9732b2 |
|
BLAKE2b-256 | 1d3373d92730b849dcb266d31f8713f8a43b81f762aa47a55e4dfebbd87704d5 |