hjson


Namehjson JSON
Version 3.1.0 PyPI version JSON
download
home_pagehttp://github.com/hjson/hjson-py
SummaryHjson, a user interface for JSON.
upload_time2022-08-13 02:53:01
maintainer
docs_urlNone
authorChristian Zangl
requires_python
licenseMIT License
keywords json comments configuration
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            hjson-py
========

`Hjson`_, a user interface for JSON

Hjson works with Python 2.5+ and Python 3.3+ (based on `simplejson`_)

Installation
============

-  ``pip install hjson``

-  or download from https://pypi.python.org/pypi/hjson

Commandline
-----------

::

    Usage:
      hjson [options]
      hjson [options] <input>
      hjson (-h | --help)
      hjson (-V | --version)

    Options:
      -h --help     Show this screen.
      -j            Output as formatted JSON.
      -c            Output as JSON.
      -V --version  Show version.

E.g. ``echo '{"json":"obj"}' | hjson``


Usage
=====

.. code-block:: python

    import hjson

Decoding Hjson
--------------

.. code-block:: python

    text = """{
      foo: a
      bar: 1
    }"""

    hjson.loads(text)

Result:

.. code-block:: python

    OrderedDict([('foo', 'a'), ('bar', 1)])

Encoding Python object hierarchies
----------------------------------

.. code-block:: python

    hjson.dumps({'foo': 'text', 'bar': (1, 2)})

Result:

::

    {
      foo: text
      bar:
      [
        1
        2
      ]
    }

Encoding as JSON
----------------

Note that this is probably not as performant as the simplejson version.

.. code-block:: python

    hjson.dumpsJSON(['foo', {'bar': ('baz', None, 1.0, 2)}])

Result: ``'["foo", {"bar": ["baz", null, 1.0, 2]}]'``

API
===

`hjson-py`_

.. _Hjson: https://hjson.github.io
.. _simplejson: https://github.com/simplejson/simplejson
.. _hjson-py: http://hjson.github.io/hjson-py/

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/hjson/hjson-py",
    "name": "hjson",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "json comments configuration",
    "author": "Christian Zangl",
    "author_email": "laktak@cdak.net",
    "download_url": "https://files.pythonhosted.org/packages/82/e5/0b56d723a76ca67abadbf7fb71609fb0ea7e6926e94fcca6c65a85b36a0e/hjson-3.1.0.tar.gz",
    "platform": "any",
    "description": "hjson-py\n========\n\n`Hjson`_, a user interface for JSON\n\nHjson works with Python 2.5+ and Python 3.3+ (based on `simplejson`_)\n\nInstallation\n============\n\n-  ``pip install hjson``\n\n-  or download from https://pypi.python.org/pypi/hjson\n\nCommandline\n-----------\n\n::\n\n    Usage:\n      hjson [options]\n      hjson [options] <input>\n      hjson (-h | --help)\n      hjson (-V | --version)\n\n    Options:\n      -h --help     Show this screen.\n      -j            Output as formatted JSON.\n      -c            Output as JSON.\n      -V --version  Show version.\n\nE.g. ``echo '{\"json\":\"obj\"}' | hjson``\n\n\nUsage\n=====\n\n.. code-block:: python\n\n    import hjson\n\nDecoding Hjson\n--------------\n\n.. code-block:: python\n\n    text = \"\"\"{\n      foo: a\n      bar: 1\n    }\"\"\"\n\n    hjson.loads(text)\n\nResult:\n\n.. code-block:: python\n\n    OrderedDict([('foo', 'a'), ('bar', 1)])\n\nEncoding Python object hierarchies\n----------------------------------\n\n.. code-block:: python\n\n    hjson.dumps({'foo': 'text', 'bar': (1, 2)})\n\nResult:\n\n::\n\n    {\n      foo: text\n      bar:\n      [\n        1\n        2\n      ]\n    }\n\nEncoding as JSON\n----------------\n\nNote that this is probably not as performant as the simplejson version.\n\n.. code-block:: python\n\n    hjson.dumpsJSON(['foo', {'bar': ('baz', None, 1.0, 2)}])\n\nResult: ``'[\"foo\", {\"bar\": [\"baz\", null, 1.0, 2]}]'``\n\nAPI\n===\n\n`hjson-py`_\n\n.. _Hjson: https://hjson.github.io\n.. _simplejson: https://github.com/simplejson/simplejson\n.. _hjson-py: http://hjson.github.io/hjson-py/\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Hjson, a user interface for JSON.",
    "version": "3.1.0",
    "split_keywords": [
        "json",
        "comments",
        "configuration"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "ff4571399698bf81c748a54042ac4237",
                "sha256": "65713cdcf13214fb554eb8b4ef803419733f4f5e551047c9b711098ab7186b89"
            },
            "downloads": -1,
            "filename": "hjson-3.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ff4571399698bf81c748a54042ac4237",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 54018,
            "upload_time": "2022-08-13T02:52:59",
            "upload_time_iso_8601": "2022-08-13T02:52:59.899571Z",
            "url": "https://files.pythonhosted.org/packages/1f/7f/13cd798d180af4bf4c0ceddeefba2b864a63c71645abc0308b768d67bb81/hjson-3.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "6cf6947b3bdc0c58608a378ac05a451c",
                "sha256": "55af475a27cf83a7969c808399d7bccdec8fb836a07ddbd574587593b9cdcf75"
            },
            "downloads": -1,
            "filename": "hjson-3.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6cf6947b3bdc0c58608a378ac05a451c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 40541,
            "upload_time": "2022-08-13T02:53:01",
            "upload_time_iso_8601": "2022-08-13T02:53:01.919984Z",
            "url": "https://files.pythonhosted.org/packages/82/e5/0b56d723a76ca67abadbf7fb71609fb0ea7e6926e94fcca6c65a85b36a0e/hjson-3.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-08-13 02:53:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hjson",
    "github_project": "hjson-py",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "hjson"
}
        
Elapsed time: 0.01201s