This Python package is a magic command that executes Python code in code cells on Jupyter and Google Colab using PyScript within an iframe.
Project description
jsonicdict
概要
jsonicdictは、PythonのListやDict等をJSONと全く同じ表記で記述できるようにするためのライブラリです。
インストール
pip install jsonicdict
使い方
from jsonicdict import true, false, null
サンプル
from jsonicdict import true, false, null
objnull = null
objfalse = false
objtrue = true
objnum = 200
objstr = "string"
objarray = [1, "string", true, false, null, {"key": "value"}]
objdict = {"null": null, "array": [1, 2, 3], "string": "string", "number": 1, "boolean": true, "false": false, "object": {"key": "value"}}
print(objnull) # -> None
print(objfalse) # -> False
print(objtrue) # -> True
print(objnum) # -> 200
print(objstr) # -> string
print(objarray) # -> [1, 'string', True, False, None, {'key': 'value'}]
print(objdict) # -> {'null': None, 'array': [1, 2, 3], 'string': 'string', 'number': 1, 'boolean': True, 'false': False, 'object': {'key': 'value'}}
import json
jsonnull = json.loads('null')
jsonfalse = json.loads('false')
jsontrue = json.loads('true')
jsonnum = json.loads('200')
jsonstr = json.loads('"string"')
jsonarray = json.loads('[1, "string", true, false, null, {"key": "value"}]')
jsondict = json.loads('{"null": null, "array": [1, 2, 3], "string": "string", "number": 1, "boolean": true, "false": false, "object": {"key": "value"}}')
print(jsonnull) # -> None
print(jsonfalse) # -> False
print(jsontrue) # -> True
print(jsonnum) # -> 200
print(jsonstr) # -> string
print(jsonarray) # -> [1, 'string', True, False, None, {'key': 'value'}]
print(jsondict) # -> {'null': None, 'array': [1, 2, 3], 'string': 'string', 'number': 1, 'boolean': True, 'false': False, 'object': {'key': 'value'}}
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
jsonicdict-0.0.1.tar.gz
(2.2 kB
view details)
Built Distribution
File details
Details for the file jsonicdict-0.0.1.tar.gz
.
File metadata
- Download URL: jsonicdict-0.0.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6112b9682f2099d0b4760d7219b65ef1c7b0ece0db1fb52910b39eb9b5fd574e |
|
MD5 | d26be254f477a6ac1b263185b660c909 |
|
BLAKE2b-256 | 1be7ea107fed2fb949c255298abc38d65cc96fef5ad423b0dc2984280c450a57 |
File details
Details for the file jsonicdict-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: jsonicdict-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdf237b667789c7a5087dacb5dac118352680da16db98c6302c232a9cd5b4a79 |
|
MD5 | ac4ce0632903d141bf1415a83889ed6e |
|
BLAKE2b-256 | cf55520d68f5b87d97ddb79a2d996934fb28c601e7a25cdaf4bc4713c38862fd |