{ "info": { "author": "Sun Jin", "author_email": "sunjinopensource@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "ormconfig\n=========\n\nA little orm for config file, do transformation to/from python object\n\nExamples\n--------\n\nexample.ini::\n\t\n [Section1]\n bool_field = True\n int_field = 123\n #int_default_field = 567\n float_field = 456.7\n string_field = hello, world\n\n [Section2]\n ip_field = 127.0.0.1\n ipport_field = 127.0.0.1:12345\n ipport_list_field = 127.0.0.1:12345, 127.0.0.2:12346\n\t\n\t[Section3]\n\tchoice_field = release\n\nexample.py::\n\n from ormconfig import *\n import sys\n\n class MyConfig(Config):\n class Section1(Section):\n bool_field = BoolField()\n int_field = IntField()\n int_default_field = IntField(default='default value 6')\n float_field = FloatField()\n string_field = StringField()\n class Section2(Section):\n ip_field = IPField()\n ipport_field = IPPortField()\n ipport_list_field = ListField(IPPortField())\n class Section3(Section):\n\t\t\tchoice_field = ChoiceField(StringField(), ['debug', 'release'], 'debug')\n\n try:\n config = MyConfig.load('example.ini')\n except Error as e:\n print('Failed to load file: %s' % str(e))\n sys.exit(1)\n\n print(config.Section1.bool_field)\n print(config.Section1.int_field)\n print(config.Section1.int_default_field)\n print(config.Section1.float_field)\n print(config.Section1.string_field)\n print(config.Section2.ip_field)\n print(config.Section2.ipport_field)\n print(config.Section2.ipport_list_field)\n\tprint(config.Section3.choice_field)\n\noutput::\n\n True\n 123\n default value 6\n 456.7\n hello, world\n 127.0.0.1\n ('127.0.0.1', 12345)\n [('127.0.0.1', 12345), ('127.0.0.2', 12346)]\n\trelease", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sunjinopensource/ormconfig/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "ormconfig", "package_url": "https://pypi.org/project/ormconfig/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ormconfig/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sunjinopensource/ormconfig/" }, "release_url": "https://pypi.org/project/ormconfig/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "A little orm for config file", "version": "0.1.3" }, "last_serial": 1935253, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "359637345270da30477484426c645364", "sha256": "0e6a47c69bb93b3da560324f56b6d7513ced6561ba9317a32ecaa0586969c15f" }, "downloads": -1, "filename": "ormconfig-0.1.0.zip", "has_sig": false, "md5_digest": "359637345270da30477484426c645364", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6217, "upload_time": "2015-05-19T05:12:40", "url": "https://files.pythonhosted.org/packages/29/80/cca50cc6bf1e8a49aab12001664eead3139a73511e9d87c7dbe93fdf1e82/ormconfig-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "0413a425dd1e1a31a7096afb572b03e3", "sha256": "413360b09e0748f9664ec3597ec1b1932090e0f815ae8dfd227496f5564301f4" }, "downloads": -1, "filename": "ormconfig-0.1.1.zip", "has_sig": false, "md5_digest": "0413a425dd1e1a31a7096afb572b03e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6284, "upload_time": "2015-07-02T08:49:00", "url": "https://files.pythonhosted.org/packages/75/1e/d227c7ca99a216625385c36006ebbf1d57acecf3103bb8558f37be850580/ormconfig-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6d6f3c342457a4f25b21d403f842b858", "sha256": "d74f284fa62ec8d6b483e0d0704969f8e1467c810806a8e957227f07c4606f5b" }, "downloads": -1, "filename": "ormconfig-0.1.2.zip", "has_sig": false, "md5_digest": "6d6f3c342457a4f25b21d403f842b858", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6707, "upload_time": "2015-11-05T06:59:51", "url": "https://files.pythonhosted.org/packages/d4/38/408d6317dff9258838d877d8b54dfb7d2f611135af3811af6c9b0a1cdfdc/ormconfig-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "8afa11de7045c2fbebfcf73ba9c79e6b", "sha256": "cff0e025c5aad2142bdf1167d7575ff87e0422e3c0920fbb723c6718bcfcfe11" }, "downloads": -1, "filename": "ormconfig-0.1.3.zip", "has_sig": false, "md5_digest": "8afa11de7045c2fbebfcf73ba9c79e6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6997, "upload_time": "2016-02-02T09:13:15", "url": "https://files.pythonhosted.org/packages/ab/52/10984f09b1c7c4ff32f2b7bb5ee87b2614cb9cbadfc7dc6fafc4c39e3b00/ormconfig-0.1.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8afa11de7045c2fbebfcf73ba9c79e6b", "sha256": "cff0e025c5aad2142bdf1167d7575ff87e0422e3c0920fbb723c6718bcfcfe11" }, "downloads": -1, "filename": "ormconfig-0.1.3.zip", "has_sig": false, "md5_digest": "8afa11de7045c2fbebfcf73ba9c79e6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6997, "upload_time": "2016-02-02T09:13:15", "url": "https://files.pythonhosted.org/packages/ab/52/10984f09b1c7c4ff32f2b7bb5ee87b2614cb9cbadfc7dc6fafc4c39e3b00/ormconfig-0.1.3.zip" } ] }