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

Uploaded Source

Built Distribution

jsonicdict-0.0.3-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jsonicdict-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 040d359fb45b66269ccd9cb4291fe5190bca8ffb399d810f0708c809b1325384
MD5 355be70e3169ecd015da5ba1ce5b2a2f
BLAKE2b-256 f346794299921274d4ef00b2431d0dc8ea1e2e586fc93a111f95de0f1992a715

See more details on using hashes here.

File details

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

File metadata

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

Hashes for jsonicdict-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8b0b93d837616b1bda8fb8fa2a5bd73ba5af4ec75cdbc930503891b8aae4a183
MD5 5c3258164a6c8a7edff8f9162be8b519
BLAKE2b-256 939a8d0ec0625fae29bf8964930eac01e09d80341ec25c9770341782f20d4bb0

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