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
使い方
import jsonicdict
または
from jsonicdict import true, false, null
サンプル
import jsonicdict
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-1.0.0.tar.gz
(2.2 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
File details
Details for the file jsonicdict-1.0.0.tar.gz.
File metadata
- Download URL: jsonicdict-1.0.0.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 |
2fb93c67402b45d2abeb44eb7e1d181037ac43613dc35d4603602b8987034a23
|
|
| MD5 |
aedbc377ea55d054e27d54bf72e5d8a2
|
|
| BLAKE2b-256 |
55d9d704a9b410e6b870165834337340bf50ac4a98c5e949e81363f41c77ea22
|
File details
Details for the file jsonicdict-1.0.0-py3-none-any.whl.
File metadata
- Download URL: jsonicdict-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.3 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 |
16dacd515cadba0c2f267fb3c9752349c6d38324ce4d8e2ee7c33c6147047afc
|
|
| MD5 |
73ca3c3c2edc7d0c99f23ac27101c8ea
|
|
| BLAKE2b-256 |
7c3b723e50c03ab1fdc57b56c977deab02824bf3701b0e6097b31cab3a9a4bcd
|