jsonicdict


Namejsonicdict JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryThis Python package is a magic command that executes Python code in code cells on Jupyter and Google Colab using PyScript within an iframe.
upload_time2024-11-19 12:11:51
maintainerNone
docs_urlNone
authorUniras
requires_pythonNone
licenseMIT License
keywords json dict
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # jsonicdict

## 概要

jsonicdictは、PythonのListやDict等をJSONと全く同じ表記で記述できるようにするためのライブラリです。

## インストール

```bash
pip install jsonicdict
```

## 使い方

```python
import jsonicdict
```

または

```python
from jsonicdict import true, false, null
```

## サンプル

```python
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'}}

```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "jsonicdict",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "json, dict",
    "author": "Uniras",
    "author_email": "tkappeng@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/55/d9/d704a9b410e6b870165834337340bf50ac4a98c5e949e81363f41c77ea22/jsonicdict-1.0.0.tar.gz",
    "platform": null,
    "description": "# jsonicdict\r\n\r\n## \u6982\u8981\r\n\r\njsonicdict\u306f\u3001Python\u306eList\u3084Dict\u7b49\u3092JSON\u3068\u5168\u304f\u540c\u3058\u8868\u8a18\u3067\u8a18\u8ff0\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\r\n\r\n## \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\r\n```bash\r\npip install jsonicdict\r\n```\r\n\r\n## \u4f7f\u3044\u65b9\r\n\r\n```python\r\nimport jsonicdict\r\n```\r\n\r\n\u307e\u305f\u306f\r\n\r\n```python\r\nfrom jsonicdict import true, false, null\r\n```\r\n\r\n## \u30b5\u30f3\u30d7\u30eb\r\n\r\n```python\r\nimport jsonicdict\r\n\r\nobjnull = null\r\nobjfalse = false\r\nobjtrue = true\r\nobjnum = 200\r\nobjstr = \"string\"\r\nobjarray = [1, \"string\", true, false, null, {\"key\": \"value\"}]\r\nobjdict = {\"null\": null, \"array\": [1, 2, 3], \"string\": \"string\", \"number\": 1, \"boolean\": true, \"false\": false, \"object\": {\"key\": \"value\"}}\r\n\r\nprint(objnull)    # -> None\r\nprint(objfalse)   # -> False\r\nprint(objtrue)    # -> True\r\nprint(objnum)     # -> 200\r\nprint(objstr)     # -> string\r\nprint(objarray)   # -> [1, 'string', True, False, None, {'key': 'value'}]\r\nprint(objdict)    # -> {'null': None, 'array': [1, 2, 3], 'string': 'string', 'number': 1, 'boolean': True, 'false': False, 'object': {'key': 'value'}}\r\n\r\nimport json\r\n\r\njsonnull = json.loads('null')\r\njsonfalse = json.loads('false')\r\njsontrue = json.loads('true')\r\njsonnum = json.loads('200')\r\njsonstr = json.loads('\"string\"')\r\njsonarray = json.loads('[1, \"string\", true, false, null, {\"key\": \"value\"}]')\r\njsondict = json.loads('{\"null\": null, \"array\": [1, 2, 3], \"string\": \"string\", \"number\": 1, \"boolean\": true, \"false\": false, \"object\": {\"key\": \"value\"}}')\r\n\r\nprint(jsonnull)    # -> None\r\nprint(jsonfalse)   # -> False\r\nprint(jsontrue)    # -> True\r\nprint(jsonnum)     # -> 200\r\nprint(jsonstr)     # -> string\r\nprint(jsonarray)   # -> [1, 'string', True, False, None, {'key': 'value'}]\r\nprint(jsondict)    # -> {'null': None, 'array': [1, 2, 3], 'string': 'string', 'number': 1, 'boolean': True, 'false': False, 'object': {'key': 'value'}}\r\n\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "This Python package is a magic command that executes Python code in code cells on Jupyter and Google Colab using PyScript within an iframe.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/uniras/jsondict",
        "Repository": "https://github.com/uniras/jsondict"
    },
    "split_keywords": [
        "json",
        " dict"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c3b723e50c03ab1fdc57b56c977deab02824bf3701b0e6097b31cab3a9a4bcd",
                "md5": "73ca3c3c2edc7d0c99f23ac27101c8ea",
                "sha256": "16dacd515cadba0c2f267fb3c9752349c6d38324ce4d8e2ee7c33c6147047afc"
            },
            "downloads": -1,
            "filename": "jsonicdict-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "73ca3c3c2edc7d0c99f23ac27101c8ea",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 2253,
            "upload_time": "2024-11-19T12:11:49",
            "upload_time_iso_8601": "2024-11-19T12:11:49.437944Z",
            "url": "https://files.pythonhosted.org/packages/7c/3b/723e50c03ab1fdc57b56c977deab02824bf3701b0e6097b31cab3a9a4bcd/jsonicdict-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "55d9d704a9b410e6b870165834337340bf50ac4a98c5e949e81363f41c77ea22",
                "md5": "aedbc377ea55d054e27d54bf72e5d8a2",
                "sha256": "2fb93c67402b45d2abeb44eb7e1d181037ac43613dc35d4603602b8987034a23"
            },
            "downloads": -1,
            "filename": "jsonicdict-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "aedbc377ea55d054e27d54bf72e5d8a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2225,
            "upload_time": "2024-11-19T12:11:51",
            "upload_time_iso_8601": "2024-11-19T12:11:51.240767Z",
            "url": "https://files.pythonhosted.org/packages/55/d9/d704a9b410e6b870165834337340bf50ac4a98c5e949e81363f41c77ea22/jsonicdict-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-19 12:11:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "uniras",
    "github_project": "jsondict",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "jsonicdict"
}
        
Elapsed time: 0.36870s