simple-flatten-json


Namesimple-flatten-json JSON
Version 0.0.9 PyPI version JSON
download
home_pagehttps://github.com/at-75/simple_json_flatten_py
SummaryFor flattening complex JSONs
upload_time2023-03-31 06:40:19
maintainer
docs_urlNone
authorAbhishek Thakur
requires_python<4,>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Usage

simple_json_flatten_py is a Python library for flattening complex JSONs

From

```JSON
{
"a": [ {"b":37},{"c":64}],
"g": 26
}
```
To

```
{
  "a_b":37,
  "a_c":64,
  "g":26
}
```

```Python
from simple_flatten_json_py import simple_flatten_json

# Sample JSON data
data={
   "cat":[
      {
         "fish":"tuna"
      },
      {
         "chicken":3
      },
      {
         "medicine":{
            "pills":5
         }
      }
   ]
}
# returns a flattened json 
# {"cat_0_fish": "tuna",  "cat_1_chicken": 3,"cat_2_medicine_pills": 20}

print(simple_flatten_json.flatten_json(data))
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/at-75/simple_json_flatten_py",
    "name": "simple-flatten-json",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4,>=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Abhishek Thakur",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/10/d3/be2f6043efff97bd25fa68fec7cbb7d8969f3cc5c897a609bce7bbee537a/simple_flatten_json-0.0.9.tar.gz",
    "platform": null,
    "description": "# Usage\r\n\r\nsimple_json_flatten_py is a Python library for flattening complex JSONs\r\n\r\nFrom\r\n\r\n```JSON\r\n{\r\n\"a\": [ {\"b\":37},{\"c\":64}],\r\n\"g\": 26\r\n}\r\n```\r\nTo\r\n\r\n```\r\n{\r\n  \"a_b\":37,\r\n  \"a_c\":64,\r\n  \"g\":26\r\n}\r\n```\r\n\r\n```Python\r\nfrom simple_flatten_json_py import simple_flatten_json\r\n\r\n# Sample JSON data\r\ndata={\r\n   \"cat\":[\r\n      {\r\n         \"fish\":\"tuna\"\r\n      },\r\n      {\r\n         \"chicken\":3\r\n      },\r\n      {\r\n         \"medicine\":{\r\n            \"pills\":5\r\n         }\r\n      }\r\n   ]\r\n}\r\n# returns a flattened json \r\n# {\"cat_0_fish\": \"tuna\",  \"cat_1_chicken\": 3,\"cat_2_medicine_pills\": 20}\r\n\r\nprint(simple_flatten_json.flatten_json(data))\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "For flattening complex JSONs",
    "version": "0.0.9",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "373bfc9fd53b0061efaa4e0835d4f5c8c56f28874b80901631c31364a856069e",
                "md5": "f5ce08bbf13f4e51312cc91b0c3d757e",
                "sha256": "f30b84205aa8bd13d1e5bdfbebac8f3bcaa358e724afce5821fdfd7b4be0fdfa"
            },
            "downloads": -1,
            "filename": "simple_flatten_json-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5ce08bbf13f4e51312cc91b0c3d757e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.7",
            "size": 3162,
            "upload_time": "2023-03-31T06:40:17",
            "upload_time_iso_8601": "2023-03-31T06:40:17.349480Z",
            "url": "https://files.pythonhosted.org/packages/37/3b/fc9fd53b0061efaa4e0835d4f5c8c56f28874b80901631c31364a856069e/simple_flatten_json-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "10d3be2f6043efff97bd25fa68fec7cbb7d8969f3cc5c897a609bce7bbee537a",
                "md5": "82b95d3afd862c94b18c7a4f49ba8a7c",
                "sha256": "1fbc1f2760edc7693b01093408c8a7bba8668a9df2c24d36beeda14e49f00e1c"
            },
            "downloads": -1,
            "filename": "simple_flatten_json-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "82b95d3afd862c94b18c7a4f49ba8a7c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.7",
            "size": 2588,
            "upload_time": "2023-03-31T06:40:19",
            "upload_time_iso_8601": "2023-03-31T06:40:19.597628Z",
            "url": "https://files.pythonhosted.org/packages/10/d3/be2f6043efff97bd25fa68fec7cbb7d8969f3cc5c897a609bce7bbee537a/simple_flatten_json-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-31 06:40:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "at-75",
    "github_project": "simple_json_flatten_py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "simple-flatten-json"
}
        
Elapsed time: 1.36670s