Skip to main content

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.2.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

jsonicdict-0.0.2-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file jsonicdict-0.0.2.tar.gz.

File metadata

  • Download URL: jsonicdict-0.0.2.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

Hashes for jsonicdict-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a91f565fabfd7a6f316bccdccc9233b46fc4058b5f7cf7da731e3635a8afab30
MD5 ca8bb50357075290ebb4c57e2dcd331e
BLAKE2b-256 deb642ef47d7d081b52021492765cf256f7b4512388d29e6824c02c950c7ac03

See more details on using hashes here.

File details

Details for the file jsonicdict-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: jsonicdict-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for jsonicdict-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8bab18dbf0a585372fe99f902e3ba5024aa571e8d71c6b353694332eb4d6bb54
MD5 5b23ef81729566d172222e624e2e373d
BLAKE2b-256 c878e720653ba7cb4f1c0b9443f4709a6a5862e242618f37d82d16ea378f8e36

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page