dfsjson


Namedfsjson JSON
Version 1.1.2 PyPI version JSON
download
home_pagehttps://github.com/AutomaticHourglass/dfsjson
SummaryA robust JSON encoder that fixes errors by utilizing DFS algorithm.
upload_time2023-04-29 09:49:52
maintainer
docs_urlNone
authorUnsal Gokdag
requires_python>=3.8,<4.0
license
keywords json json serialize dfs error correcting json
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DFS JSON
A Depth First Search powered JSON decoding library. For the remaining operations (dump, dumps), it uses standard python JSON library.

# Installation
```
pip install dfsjson
```

# Usage

```
# Create a complex JSON object
example_json = """{
    "key1": "value1'
    "key2": [1 2, 3]
    "key3":  {
        "subkey1": "subvalue1"
        "subkey2": "subvalue2"
    ,
}"""

dj = DFSJson(max_depth = 100, max_diff = 10)
dj.loads(example_json)

```

# Discussion
### Hey I know this. Why not have you used Breadth First Search?
Technically you are correct but keep in mind that Breadth First Search keeps the previous states in its list which 
scales with number of iterations you are making and it can be a huge strain on the memory.

However, Depth First search requires only O(log(n)) memory complexity in which we can search a lot more possibilities.

# Contribution
Please don't hesitate to create issues and pull requests since this is developed overnight.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/AutomaticHourglass/dfsjson",
    "name": "dfsjson",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "JSON,JSON Serialize,DFS,Error correcting JSON",
    "author": "Unsal Gokdag",
    "author_email": "unsal.gokdag@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/49/57/6b297fc1b16beb76e2f04375e51ec29b6a2bbf6c4c0eab5909b3b6d56a38/dfsjson-1.1.2.tar.gz",
    "platform": null,
    "description": "# DFS JSON\nA Depth First Search powered JSON decoding library. For the remaining operations (dump, dumps), it uses standard python JSON library.\n\n# Installation\n```\npip install dfsjson\n```\n\n# Usage\n\n```\n# Create a complex JSON object\nexample_json = \"\"\"{\n    \"key1\": \"value1'\n    \"key2\": [1 2, 3]\n    \"key3\":  {\n        \"subkey1\": \"subvalue1\"\n        \"subkey2\": \"subvalue2\"\n    ,\n}\"\"\"\n\ndj = DFSJson(max_depth = 100, max_diff = 10)\ndj.loads(example_json)\n\n```\n\n# Discussion\n### Hey I know this. Why not have you used Breadth First Search?\nTechnically you are correct but keep in mind that Breadth First Search keeps the previous states in its list which \nscales with number of iterations you are making and it can be a huge strain on the memory.\n\nHowever, Depth First search requires only O(log(n)) memory complexity in which we can search a lot more possibilities.\n\n# Contribution\nPlease don't hesitate to create issues and pull requests since this is developed overnight.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A robust JSON encoder that fixes errors by utilizing DFS algorithm.",
    "version": "1.1.2",
    "project_urls": {
        "Homepage": "https://github.com/AutomaticHourglass/dfsjson"
    },
    "split_keywords": [
        "json",
        "json serialize",
        "dfs",
        "error correcting json"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c2d84cd37680abad262d2838a5d6aa98e921a4e4d491cf709ea9a395c38c384f",
                "md5": "772f478919a28794f549237432f6fced",
                "sha256": "2fd850a75b03be581c00e39c7c7e996525fb4170313de1e3897bf7f912e68821"
            },
            "downloads": -1,
            "filename": "dfsjson-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "772f478919a28794f549237432f6fced",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 15257,
            "upload_time": "2023-04-29T09:49:50",
            "upload_time_iso_8601": "2023-04-29T09:49:50.332728Z",
            "url": "https://files.pythonhosted.org/packages/c2/d8/4cd37680abad262d2838a5d6aa98e921a4e4d491cf709ea9a395c38c384f/dfsjson-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "49576b297fc1b16beb76e2f04375e51ec29b6a2bbf6c4c0eab5909b3b6d56a38",
                "md5": "d20e8721a45e36977ec383eed0b9be5e",
                "sha256": "77dae90fa3333a546c20243f073feabfe4030d2ebd6bc03bd407fe167062163f"
            },
            "downloads": -1,
            "filename": "dfsjson-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "d20e8721a45e36977ec383eed0b9be5e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 14615,
            "upload_time": "2023-04-29T09:49:52",
            "upload_time_iso_8601": "2023-04-29T09:49:52.269671Z",
            "url": "https://files.pythonhosted.org/packages/49/57/6b297fc1b16beb76e2f04375e51ec29b6a2bbf6c4c0eab5909b3b6d56a38/dfsjson-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-29 09:49:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "AutomaticHourglass",
    "github_project": "dfsjson",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "dfsjson"
}
        
Elapsed time: 0.16637s