{ "info": { "author": "Sanhe Hu", "author_email": "husanhe@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": ".. image:: https://travis-ci.org/MacHu-GWU/utf8config-project.svg?branch=master\n :target: https://travis-ci.org/MacHu-GWU/utf8config-project?branch=master\n\n.. image:: https://codecov.io/gh/MacHu-GWU/utf8config-project/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/MacHu-GWU/utf8config-project\n\n.. image:: https://img.shields.io/pypi/v/utf8config.svg\n :target: https://pypi.python.org/pypi/utf8config\n\n.. image:: https://img.shields.io/pypi/l/utf8config.svg\n :target: https://pypi.python.org/pypi/utf8config\n\n.. image:: https://img.shields.io/pypi/pyversions/utf8config.svg\n :target: https://pypi.python.org/pypi/utf8config\n\n.. image:: https://img.shields.io/badge/Star_Me_on_GitHub!--None.svg?style=social\n :target: https://github.com/MacHu-GWU/utf8config-project\n\n\nWelcome to ``utf8config`` Documentation\n==============================================================================\nutf8 format config file IO tool.\n\nFeatures:\n\n1. Comment Control. (You can choose ignore comment or not while dumping)\n2. Allow unicode character.\n3. Smart parser for number, string, boolean, None, list.\n\nExample::\n\n # content of config.ini\n ### DEFAULT is the default section\n ### DEFAULT\u662f\u9ed8\u8ba4Section\n [DEFAULT]\n localhost = 192.168.0.1 # IP\u5730\u5740, \u9ed8\u8ba4 192.168.0.1\n port = 8080 # \u7aef\u53e3\u53f7\n\n ### \u4e0b\u9762\u7684\u662f\u5c1d\u8bd5\u8fde\u63a5\u7684\u6700\u957f\u65f6\u95f4\n connection_timeout = 60 # \u5355\u4f4d\u662f\u79d2, \u9ed8\u8ba460\n\n # Test\u662f\u7528\u6765\u6d4b\u8bd5\u5404\u79cd\u6570\u636e\u7c7b\u578b\u662f\u5426\u80fd\u88ab\u6210\u529f\u89e3\u6790\u7684\n # \u7528Configuration.load()\u770b\u770b\u4f1a\u4e0d\u4f1a\u6210\u529f\u5427\n\n [TEST]\n # Single Value\n # \u4ee5\u4e0b\u662f\u5355\u503c\u9879\n # \u5373\u975e\u5217\u8868\u7684\u503c\n int = 123 # 123\n int_pos = +123 # 123\n int_neg = -123 # -123\n float = 3.14 # 3.14\n float_pos = +3.14 # 3.14\n float_neg = -3.14 # -3.14\n str = Hello World! # str \"Hello World!\"\n str_quote = 'Good Boy' # str \"Good Boy\"\n str_double_quote = \"Bad Boy\" # str \"Bad Boy\"\n str_quote_in_quote = '\"Boy\"' # str '\"Boy\"'\n str_int = '123' # str \"123\"\n str_float = '3.14' # str \"3.14\"\n str_bool = 'True' # str \"True\"\n str_path = C:\\\u7528\u6237\\\u7ba1\u7406\u5458 # str \"C:\\\u7528\u6237\\\u7ba1\u7406\u5458\"\n str_utf8 = \u4e2d\u6587 # str \"\u4e2d\u6587\"\n bool_true = True # True\n bool_yes = Yes # True\n bool_false = False # False\n bool_no = No # No\n none_none = None # None\n none_null = null # None\n none = # None\n\n # List Value\n # \u4ee5\u4e0b\u662f\u5404\u79cd\u5217\u8868\n empty_list = , # Empty list []\n int_list = 1, -2, 3 # [1, -2, 3]\n int_none_list = , -2,3 # [None -2, 3]\n float_list = 1.1, -2.2, 3.3 # [1.1, -2.2, 3.3]\n float_none_list = , -2.2,3.3 # [None -2.2, 3.3]\n str_list = a, b, c # [\"a\", \"b\", \"c\"]\n str_single_quote_list = '1', '2', '3' # [\"1\", \"2\", \"3\"]\n str_double_quote_list = \"1\", \"2\", \"3\" # [\"1\", \"2\", \"3\"]\n str_path_list = C:\\windows, C:\\\u4e2d\u6587 # [\"C:\\windows\", \"C:\\\u4e2d\u6587\"]\n str_special_list = a, '1', '3.14', \"True\", \"no\", ,\"None\" # [\"a\", \"1\", \"3.14\", \"True\", \"no\", \"None\"]\n bool_list = True, False # [True, False]\n bool_yes_no_list = Yes, No # [True, False]\n\n\nUsage:\n\nRead and Write:\n\n.. code-block:: python\n\n from utf8config import Config, Section, Field\n\n config = Config.load(\"config.ini\")\n for section_name, section in config.items():\n ...\n\n section = Config[\"DEFAULT\"]\n for field_name, field in section.items():\n ...\n\n localhost = section[\"localhost\"]\n port = section[\"port\"]\n\n localhost.key # \"localhost\"\n localhost.value # \"192.168.0.1\"\n\n with open(\"config.ini\", \"w\") as f:\n text = config.dump(\"config.ini\", ignore_comment=True)\n f.write(text)\n\n\nProgrammatically Construct Config:\n\n.. code-block:: python\n\n config = Config()\n DEFAULT = config[\"DEFAULT\"]\n DEFAULT.add_field(Field(key=\"localhost\", value=\"192.168.0.1\"))\n\n TEST = Section(\"TEST\")\n TEST.add_field(Field(key=\"numbers\", value=[1, 2, 3]))\n config.add_section(TEST)\n\n\nQuick Links\n------------------------------------------------------------------------------\n\n- .. image:: https://img.shields.io/badge/Link-Document-red.svg\n :target: http://www.wbh-doc.com.s3.amazonaws.com/utf8config/index.html\n\n- .. image:: https://img.shields.io/badge/Link-API_Reference_and_Source_Code-red.svg\n :target: http://www.wbh-doc.com.s3.amazonaws.com/utf8config/py-modindex.html\n\n- .. image:: https://img.shields.io/badge/Link-Install-red.svg\n :target: `install`_\n\n- .. image:: https://img.shields.io/badge/Link-GitHub-blue.svg\n :target: https://github.com/MacHu-GWU/utf8config-project\n\n- .. image:: https://img.shields.io/badge/Link-Submit_Issue_and_Feature_Request-blue.svg\n :target: https://github.com/MacHu-GWU/utf8config-project/issues\n\n- .. image:: https://img.shields.io/badge/Link-Download-blue.svg\n :target: https://pypi.python.org/pypi/utf8config#downloads\n\n\n.. _install:\n\nInstall\n------------------------------------------------------------------------------\n\n``utf8config`` is released on PyPI, so all you need is:\n\n.. code-block:: console\n\n $ pip install utf8config\n\nTo upgrade to latest version:\n\n.. code-block:: console\n\n $ pip install --upgrade utf8config\n\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/MacHu-GWU//tarball/2017-10-14", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MacHu-GWU/", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "utf8config", "package_url": "https://pypi.org/project/utf8config/", "platform": "Windows", "project_url": "https://pypi.org/project/utf8config/", "project_urls": { "Download": "https://github.com/MacHu-GWU//tarball/2017-10-14", "Homepage": "https://github.com/MacHu-GWU/" }, "release_url": "https://pypi.org/project/utf8config/0.0.2/", "requires_dist": [ "six", "attrs" ], "requires_python": "", "summary": "A utf8 charset config file parser", "version": "0.0.2" }, "last_serial": 3250827, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b1c6703a8d167c5cdd41d3bde19b46bd", "sha256": "4645e8f09c6a38ed46494ed7f9b830ef33b548f99d3cf043f4e4aff41bbd7700" }, "downloads": -1, "filename": "utf8config-0.0.1.zip", "has_sig": false, "md5_digest": "b1c6703a8d167c5cdd41d3bde19b46bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24264, "upload_time": "2016-09-28T20:58:37", "url": "https://files.pythonhosted.org/packages/64/76/649abd16d714aa3a9730289f7388696f1e2bdc37f6919a037e9703652592/utf8config-0.0.1.zip" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "b859fe7930d05be6b24cdce3f2cd67bf", "sha256": "c0b57c6a888ae18223ddc9489bb8681a9b4842745295ffb48a3167b5c53f2780" }, "downloads": -1, "filename": "utf8config-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "b859fe7930d05be6b24cdce3f2cd67bf", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 35043, "upload_time": "2017-10-15T00:29:01", "url": "https://files.pythonhosted.org/packages/de/be/8d95b0f1e669b90fb0e15c5e9203cb66f858cb719e4a4df7711edae15520/utf8config-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70bdf9a48516d644c53a0ea348ca18d7", "sha256": "aa2d7bc2710c49916b6c250695b77835826ebd29761b26ce3945fffe394be427" }, "downloads": -1, "filename": "utf8config-0.0.2.tar.gz", "has_sig": false, "md5_digest": "70bdf9a48516d644c53a0ea348ca18d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23943, "upload_time": "2017-10-15T00:29:02", "url": "https://files.pythonhosted.org/packages/1e/99/e724bb6ffb9df8c512c7c40f05393dbacb00294ab434bcfa8c6c85ab19d0/utf8config-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b859fe7930d05be6b24cdce3f2cd67bf", "sha256": "c0b57c6a888ae18223ddc9489bb8681a9b4842745295ffb48a3167b5c53f2780" }, "downloads": -1, "filename": "utf8config-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "b859fe7930d05be6b24cdce3f2cd67bf", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 35043, "upload_time": "2017-10-15T00:29:01", "url": "https://files.pythonhosted.org/packages/de/be/8d95b0f1e669b90fb0e15c5e9203cb66f858cb719e4a4df7711edae15520/utf8config-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "70bdf9a48516d644c53a0ea348ca18d7", "sha256": "aa2d7bc2710c49916b6c250695b77835826ebd29761b26ce3945fffe394be427" }, "downloads": -1, "filename": "utf8config-0.0.2.tar.gz", "has_sig": false, "md5_digest": "70bdf9a48516d644c53a0ea348ca18d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23943, "upload_time": "2017-10-15T00:29:02", "url": "https://files.pythonhosted.org/packages/1e/99/e724bb6ffb9df8c512c7c40f05393dbacb00294ab434bcfa8c6c85ab19d0/utf8config-0.0.2.tar.gz" } ] }