{ "info": { "author": "Li Jianfeng", "author_email": "lee_jianfeng@sjtu.edu.cn", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Build Tools" ], "description": "pycnf Python package\n==============\n\n\nThe Python package '[pycnf](https://github.com/Miachol/pycnf)' implements the\njson, configparser, yaml and toml parser for python setting and writing of configuration file.\n\n# Introduction \n\nThe configuration file are necessary for many projects that will help us to manage and set project environment variables easily.\n\nConfiguration files, from INI/XML/JSON/YAML to TOML, readability and maneuverability have been improved too much in the past few years, and there are serveral parsers be created in Python and other programming language. That have made us becomes more efficient, but, we need to remember the different functions for different format configuration file that sometimes we only just want to read it and regardless of that format. So, using single function to read or/and write most of configuration file are good way to reduce memory burden.\n\n\n[pycnf](https://github.com/Miachol/pycnf) have done some work to relax us on configuration files that can be used to parse and generate JSON/INI/YAML/TOML format configuration file.\n\n\n## Configuration file format\n\n### JSON\n``` json\n{ \"default\":{\n \"debug\":\"{{debug}} {{debug2}}\"\n },\n \"comments\":{\n \"version\":\"0.2.0\",\n \"test_parse\":\"{{key:test_parse}} {{key:test_parse2}}\",\n \"test_parse2\":\"@>@ str_replace('{{key:test_parse}}', '2', '00')@<@ {{key:test_parse2}} {{debug2}}\",\n \"test_parse3\":\"{{key:test_parse}}\",\n \"test_parse4\":\"@>@ str_replace('{{key:test_parse2}}', '2', '00')@<@ @>@ str_replace('{{key:test_parse}}', '2', '00')@<@ {{key:test_parse2}} {{debug2}}\"\n }\n}\n```\nMore infomation and example of JSON can be founded in [json.org](http://www.json.org/), [JSON Example](http://www.json.org/example.html) and [JSON-wikipedia](https://en.wikipedia.org/wiki/JSON). `{{key:key:value}}/{{key}}` can be parsed by parse.extra using `extra.list` and `other.config` parameters. `@>@ str_replace(\"123\", \"2\", \"1\")@<@` can be parsed by `parse.extra` setting parameter `rcmd.parse` to `TRUE`. Example of that can be founded in this document tail.\n\n### INI\n``` ini\n[default]\ndebug = {{debug}} {{debug2}}\n\n[comments]\nversion = 0.2.0\ntest_parse = {{key:test_parse}} {{key:test_parse2}}\ntest_parse2 = @>@ str_replace('{{key:test_parse}}', '2', '00')@<@ {{key:test_parse2}} {{debug2}}\ntest_parse3 = {{key:test_parse}}\ntest_parse4 = @>@ str_replace('{{key:test_parse2}}', '2', '00')@<@ @>@ str_replace('{{key:test_parse}}', '2', '00')@<@ {{key:test_parse2}} {{debug2}}\n```\nMore infomation and example of INI can be founded in [INI-wikipedia](https://en.wikipedia.org/wiki/INI_file).\n\n### YAML\n``` yaml\ndefault:\n debug: '{{debug}} {{debug2}}'\ncomments:\n version: 0.2.0\n test_parse: '{{key:test_parse}} {{key:test_parse2}}'\n test_parse2: '@>@ str_replace(''{{key:test_parse}}'', ''2'', ''00'')@<@ {{key:test_parse2}}\n {{debug2}}'\n test_parse3: '{{key:test_parse}}'\n test_parse4: '@>@ str_replace(''{{key:test_parse2}}'', ''2'', ''00'')@<@ @>@ str_replace(''{{key:test_parse}}'',\n ''2'', ''00'')@<@ {{key:test_parse2}} {{debug2}}'\n```\nMore infomation and example of YAML can be founded in [yaml.org](http://www.yaml.org/) and [YAML-wikipedia](https://en.wikipedia.org/wiki/YAML).\n\n### TOML\n``` toml\ntitle = \"TOML Example\"\n\n[default]\ndebug = true\n\n[comments]\nversion = \"0.1.0\"\n```\nMore infomation and example of TOML can be founded in and [toml-lang/toml](https://github.com/toml-lang/toml) and [TOML-wikipedia](https://en.wikipedia.org/wiki/TOML).\n\n# Installation\n\n## pip\n``` shell\n#You can install this package directly from PYPI by running:\npip install pycnf\n```\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Miachol/pycnf", "keywords": "configuration setuptools development", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pycnf", "package_url": "https://pypi.org/project/pycnf/", "platform": "", "project_url": "https://pypi.org/project/pycnf/", "project_urls": { "Homepage": "https://github.com/Miachol/pycnf" }, "release_url": "https://pypi.org/project/pycnf/0.0.8/", "requires_dist": null, "requires_python": "", "summary": "Implements the JSON, INI, YAML and TOML parser for Python setting and writing of configuration file.", "version": "0.0.8" }, "last_serial": 2898051, "releases": { "0.0.6": [ { "comment_text": "", "digests": { "md5": "6a2d8dea3073a8846564f7ce230fa97a", "sha256": "707de6d2f3b30b86a9c091614033f22100ef370e158470fb48901be1ac6e0a34" }, "downloads": -1, "filename": "pycnf-0.0.6.tar.gz", "has_sig": false, "md5_digest": "6a2d8dea3073a8846564f7ce230fa97a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7776, "upload_time": "2017-04-14T07:52:00", "url": "https://files.pythonhosted.org/packages/1c/b0/0ff88d94befd6670ce0ac95563753520423f0e156a8c001729ccba6574eb/pycnf-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "38f0951b493e477c12fbc8d140bc8ebf", "sha256": "527aedea9cddb6931aacde6f9bef529bc481b4b5bda102d4cb2bea119bdc0bf5" }, "downloads": -1, "filename": "pycnf-0.0.7.tar.gz", "has_sig": false, "md5_digest": "38f0951b493e477c12fbc8d140bc8ebf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7861, "upload_time": "2017-04-15T06:25:40", "url": "https://files.pythonhosted.org/packages/3b/54/fe71b9e1278ff213d65b3219418caeaa64e0aa4a70ba9296adeae7168f3d/pycnf-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "a03879c3d7b94b0623e7b19ae8143fed", "sha256": "dc3b19181d297ba1994280fed5787565e9107b64470249242a769eb4a3122261" }, "downloads": -1, "filename": "pycnf-0.0.8.tar.gz", "has_sig": false, "md5_digest": "a03879c3d7b94b0623e7b19ae8143fed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7932, "upload_time": "2017-05-25T13:20:13", "url": "https://files.pythonhosted.org/packages/ee/77/254495ff0c45e7f0e059aaa61f53faade909de4a479d4d8c3b71cf4b1a7b/pycnf-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a03879c3d7b94b0623e7b19ae8143fed", "sha256": "dc3b19181d297ba1994280fed5787565e9107b64470249242a769eb4a3122261" }, "downloads": -1, "filename": "pycnf-0.0.8.tar.gz", "has_sig": false, "md5_digest": "a03879c3d7b94b0623e7b19ae8143fed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7932, "upload_time": "2017-05-25T13:20:13", "url": "https://files.pythonhosted.org/packages/ee/77/254495ff0c45e7f0e059aaa61f53faade909de4a479d4d8c3b71cf4b1a7b/pycnf-0.0.8.tar.gz" } ] }