{ "info": { "author": "YuLun Shih", "author_email": "shih@yulun.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent" ], "description": "# JSONLibconfig\n:sparkles: Pure python implementation library provides JSON <- convert -> Libconfig\n\n## Install\n```\npip install jsonlibconfig\n```\n\n## CLI Usage\n```sh\n\u03bb ~/jsonlibconfig -h\nusage: jsonlibconfig [-h] [--target {json,libconfig}] [--pretty] [--hextoint]\n [--file FILE]\n\nPure python library provides JSON <- convert --> Libconfig\n\noptional arguments:\n -h, --help show this help message and exit\n --target {json,libconfig}\n specify output format: json, libconfig (default:\n libconfig)\n --pretty Pretty print\n --hextoint Convert HEX string to integer (only for json)\n --file FILE Input file\n```\n\n**JSON to Libconfig**\n```sh\ncat example.cfg | jsonlibconfig --target json\n```\n\n {\"hours\": {\"mon\": {\"close\": 18, \"open\": 9}, \"wed\": {\"close\": 18, \"open\": 9}, \"sun\": {\"close\": 16, \"open\": 11}, \"fri\": {\"close\": 20, \"open\": 9}, \"sat\": {\"close\": 20, \"open\": 9}, \"thu\": {\"close\": 18, \"open\": 9}, \"tue\": {\"close\": 18, \"open\": 9}}, \"name\": \"Books, Movies & More\", \"inventory\": {\"movies\": [{\"media\": \"DVD\", \"price\": 19.99, \"qty\": 11, \"title\": \"Brazil\"}, {\"media\": \"DVD\", \"price\": 18.99, \"qty\": 5, \"title\": \"The City of Lost Children\"}, {\"media\": \"Blu-Ray\", \"price\": 24.99, \"qty\": 20, \"title\": \"Memento\"}, {\"title\": \"Howard the Duck\"}], \"books\": [{\"price\": 29.99, \"author\": \"Robert Louis Stevenson\", \"qty\": 5, \"title\": \"Treasure Island\"}, {\"price\": 9.99, \"author\": \"Neal Stephenson\", \"qty\": 8, \"title\": \"Snow Crash\"}]}}\n\n**Libconfig to JSON**\n```sh\ncat example.json | jsonlibconfig --pretty\n```\n\n hours = {\n wed = {\n close = 18; \n open = 9; \n }; \n sun = {\n close = 16; \n open = 11; \n }; \n fri = {\n close = 20; \n open = 9; \n }; \n tue = {\n close = 18; \n open = 9; \n }; \n mon = {\n close = 18; \n open = 9; \n }; \n thu = {\n close = 18; \n open = 9; \n }; \n sat = {\n close = 20; \n open = 9; \n }; \n }; \n name = \"Books, Movies & More\"; \n inventory = {\n movies = (\n {\n media = \"DVD\"; \n price = 19.99; \n title = \"Brazil\"; \n qty = 11; \n }, \n {\n media = \"DVD\"; \n price = 18.99; \n title = \"The City of Lost Children\"; \n qty = 5; \n }, \n {\n media = \"Blu-Ray\"; \n price = 24.99; \n title = \"Memento\"; \n qty = 20; \n }, \n {\n title = \"Howard the Duck\"; \n }\n ); \n books = (\n {\n title = \"Treasure Island\"; \n price = 29.99; \n qty = 5; \n author = \"Robert Louis Stevenson\"; \n }, \n {\n title = \"Snow Crash\"; \n price = 9.99; \n qty = 8; \n author = \"Neal Stephenson\"; \n }\n ); \n }; \n\n\n\n## API\n```python\nfrom jsonlibconfig import encoder\nfrom jsonlibconfig import decoder\n```\n\n**from json to libconfig**\n```python\nencoder.dumps(json.loads(inputs))\n```\n\n**from libconfig to json**\n```python\ndecoder.loads(inputs))\n```\n\n## License\n[MIT](http://yulun.mit-license.org)", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/imZack/json-libconfig", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "jsonlibconfig", "package_url": "https://pypi.org/project/jsonlibconfig/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsonlibconfig/", "project_urls": { "Homepage": "https://github.com/imZack/json-libconfig" }, "release_url": "https://pypi.org/project/jsonlibconfig/0.0.4/", "requires_dist": null, "requires_python": null, "summary": ":sparkles: Pure python implementation library provides JSON <- convert -> Libconfig", "version": "0.0.4" }, "last_serial": 1637371, "releases": { "0.0.1": [], "0.0.2": [], "0.0.4": [ { "comment_text": "", "digests": { "md5": "934a26d99338ad5e2b6757b2f4667ab0", "sha256": "3a7acda139f3ac1c60e04ef60335f31869196de7b106bfd185017a37deedf3b8" }, "downloads": -1, "filename": "jsonlibconfig-0.0.4.tar.gz", "has_sig": false, "md5_digest": "934a26d99338ad5e2b6757b2f4667ab0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9712, "upload_time": "2015-07-17T05:19:48", "url": "https://files.pythonhosted.org/packages/5f/ab/19eaaa57ab90112b867a27cb3cbb471b0f044d174c1e69096600b008531b/jsonlibconfig-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "934a26d99338ad5e2b6757b2f4667ab0", "sha256": "3a7acda139f3ac1c60e04ef60335f31869196de7b106bfd185017a37deedf3b8" }, "downloads": -1, "filename": "jsonlibconfig-0.0.4.tar.gz", "has_sig": false, "md5_digest": "934a26d99338ad5e2b6757b2f4667ab0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9712, "upload_time": "2015-07-17T05:19:48", "url": "https://files.pythonhosted.org/packages/5f/ab/19eaaa57ab90112b867a27cb3cbb471b0f044d174c1e69096600b008531b/jsonlibconfig-0.0.4.tar.gz" } ] }