{ "info": { "author": "HotNow", "author_email": "admin@hot-now.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# CSJ Parser for Python\n\n[![N|package](https://img.shields.io/pypi/v/csj-parser.svg)](https://pypi.python.org/pypi/csj-parser) [![Build Status](https://circleci.com/gh/panuwizzle/csj-parser.svg?style=svg)](https://circleci.com/gh/panuwizzle/csj-parser)\n\nComma Separated JSON (CSJ) is a CSV like file format designed for stream processing where each cell is valid JSON. This makes it very similar to CSV, but without the problems that CSV has.\n\nFor more information, please visit [https://kirit.com/Comma%20Separated%20JSON]\n\n## Installation\n\nCSJ Parser requires Python 3.5 or later to run.\nCSJ Parser can be installed using pip:\n\n```\n$ pip install csj-parser\n```\nIf you want the latest release, you can install from git:\n```\n$ pip install git+https://github.com/Proteus-tech/csj-parser.git\n```\n\n## Examples\n\nConvert JSON to CSJ\n```python\nfrom csj_parser.csj import Csj\n\njson_list = [\n {\n \"key1\" : \"value1\",\n \"key2\" : [\"item1\", \"item2\", \"item3\"],\n \"key3\" : {\"key\" : \"value\"}\n },\n {\n \"key1\" : 10,\n \"key2\" : None,\n \"key3\" : None\n }\n]\n\n# This function returns a string of data in CSJ format\ndef convert_json_to_csj(json_dict):\n csj_string = Csj.from_dicts(json_dict)\n return csj_string\n \nconvert_json_to_csj(json_list)\n```\nOutput\n```\n\"key1\",\"key2\",\"key3\"\n\"value1\",[\"item1\",\"item2\",\"item3\"], {\"key\":\"value\"}\n10,null,null\n```\nConvert CSJ to JSON\n```python\nfrom csj_parser.csj import Csj\n\ncsj_str = '''\"key1\",\"key2\",\"key3\"\\n\"value1\",\"value2\",\"value3\"\\n\"value4\",\"value5\",\"value6\"\\n'''\n\n# This function returns a dictionary of data in JSON format\ndef convert_csj_to_json(csj_string):\n json_dict = Csj.to_dict(csj_string)\n return json_dict\n \nconvert_csj_to_json(csj_str)\n```\nOutput\n```\n[{'key1': 'value1', 'key2': 'value2', 'key3': 'value3'},{'key1': 'value4', 'key2': 'value5', 'key3': 'value6'}]\n```\n\n[//]: #\n\n[https://kirit.com/Comma%20Separated%20JSON]: ", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Proteus-tech/csj-parser", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "csj-parser", "package_url": "https://pypi.org/project/csj-parser/", "platform": "", "project_url": "https://pypi.org/project/csj-parser/", "project_urls": { "Homepage": "https://github.com/Proteus-tech/csj-parser" }, "release_url": "https://pypi.org/project/csj-parser/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "CSJ for Python", "version": "0.0.2" }, "last_serial": 5118677, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b99777b08bb39b51b271f63f7566dbb8", "sha256": "682408cdae542e053630b0c785b900b9325d21711f54df46cd454e6513b8b58b" }, "downloads": -1, "filename": "csj_parser-0.0.1-7.tar.gz", "has_sig": false, "md5_digest": "b99777b08bb39b51b271f63f7566dbb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2552, "upload_time": "2019-04-09T12:21:33", "url": "https://files.pythonhosted.org/packages/17/7d/3ff27a9acf3cf62c8036184200fb348f501c1241b981cb6c5ea8088c5974/csj_parser-0.0.1-7.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "8a65a095b81dec9012dbb1d610e9766e", "sha256": "5ea26b7ca879ded7937084ae902583ccd891fa7d11599c9d5b2a974baecf53ce" }, "downloads": -1, "filename": "csj_parser-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8a65a095b81dec9012dbb1d610e9766e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2561, "upload_time": "2019-04-09T12:59:19", "url": "https://files.pythonhosted.org/packages/66/9b/956f1ceaecbd1ceb444baa8cacd51abd5894a9a7963b05d1cc14986383f1/csj_parser-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a65a095b81dec9012dbb1d610e9766e", "sha256": "5ea26b7ca879ded7937084ae902583ccd891fa7d11599c9d5b2a974baecf53ce" }, "downloads": -1, "filename": "csj_parser-0.0.2.tar.gz", "has_sig": false, "md5_digest": "8a65a095b81dec9012dbb1d610e9766e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2561, "upload_time": "2019-04-09T12:59:19", "url": "https://files.pythonhosted.org/packages/66/9b/956f1ceaecbd1ceb444baa8cacd51abd5894a9a7963b05d1cc14986383f1/csj_parser-0.0.2.tar.gz" } ] }