{ "info": { "author": "Donggun LEE", "author_email": "gnyotnu39@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License" ], "description": "# ConfigHelper\nCan use it to save or recall preferences from Python.\n - Copyright (c) 2019 [InfoLab](http://infolab.kunsan.ac.kr) ([Donggun LEE](http://duration.digimoon.net/))\n - How to install\n ```bash\n pip install ConfigHelper\n ```\n - Other version\n ```bash\n # 0.0.3\n pip install ConfigHelper==0.0.3\n ```\n - Functions\n ```python\n config = ConfigHelper(data:dict)\n config = ConfigHelper(path:str) # URL is not supported.\n config = ConfigHelper(cls:type) # Class\n config = ConfigHelper(obj) # is not None\n\n # Returns the value.\n def getValue(key:str):\n return Value\n\n # Modify or add new value. \n def setValue(key:str, value:object):\n return None\n\n # Create New Object. (Init Variable)\n def newObject(cls:Class):\n return Object\n\n # Put a value in Object\n def setObject(obj:Object):\n pass\n\n # Return as \"Dictionary\".\n def toDict():\n return Dictionary\n\n # Return as \"JSON\".\n def toJSON():\n return String(=JSON)\n\n # Return as \"File\".\n def toFile(path:string):\n return file\n ```\n\n - How to use\n\n - Test Class\n ```python\n # Test Class\n class Test:\n def __init__(self):\n self.name = \"Donggun LEE\"\n self.age = 24\n\n def __str__(self):\n return \"name : {}, age : {}\".format(self.name, self.age)\n ```\n - Import ConfigHelper\n ```python\n from ConfigHelper import Config\n ```\n - Config None Example\n ```python\n # Config None Example\n print(\"Config None Example\")\n cfg_none = Config()\n cfg_none.setValue(\"Version\", \"0.0.1\")\n cfg_none.setValue(\"isTemporary\", 0)\n cfg_none.setValue(\"isUserMode\", 1)\n\n print(cfg_none.isTemporary)\n \"\"\"\n 0\n \"\"\"\n print(cfg_none.Version)\n \"\"\"\n 0.0.1\n \"\"\"\n\n print(cfg_none.toJSON())\n \"\"\"\n {\n \"Version\": \"0.0.1\",\n \"isTemporary\": 0,\n \"isUserMode\": 1\n }\n \"\"\"\n\n test = Test()\n print(test)\n \"\"\"\n name : Donggun LEE, age : 24\n \"\"\"\n cfg_none.setValue(\"name\", \"LEE Donggun\")\n cfg_none.setObject(test)\n print(test)\n \"\"\"\n name : LEE Donggun, age : 24\n \"\"\"\n try:\n print(test.Version)\n \"\"\"\n \"\"\"\n except Exception as e:\n print(e)\n \"\"\"\n 'Test' object has no attribute 'Version'\n \"\"\"\n\n print(cfg_none.Version)\n \"\"\"\n 0.0.1\n \"\"\"\n\n print(cfg_none.toDict()['Version'])\n \"\"\"\n 0.0.1\n \"\"\"\n\n cfg_none.toFile(\"d:/a/b/c/d/e/f/config.json\")\n ```\n - Config Dictionaray Example\n ```python\n # Config Dictionaray Example\n print(\"Config Dictionaray Example\")\n\n cfg_dict = Config({\"name\":\"LEE Donggun\", \"age\":40})\n print(cfg_dict)\n \"\"\"\n {\n \"age\": 40,\n \"name\": \"LEE Donggun\"\n }\n \"\"\"\n test = cfg_dict.newObject(Test)\n print(test)\n \"\"\"\n name : LEE Donggun, age : 40\n \"\"\"\n cfg_dict.setValue(\"age\",70)\n cfg_dict.setObject(test)\n print(test)\n \"\"\"\n name : LEE Donggun, age : 70\n \"\"\"\n ```\n - Config File Example\n ```python\n # Config File Example\n print(\"Config File Example\")\n cfg_file = Config(\"d:/a/b/c/d/e/f/config.json\")\n print(cfg_file)\n \"\"\"\n {\n \"Version\": \"0.0.1\",\n \"isTemporary\": 0,\n \"isUserMode\": 1,\n \"name\": \"LEE Donggun\"\n }\n \"\"\"\n ```\n - Config Class Example\n ```python\n # Config Class Example\n print(\"Config Class Example\")\n\n cfg_class = Config(Test)\n print(cfg_class)\n \"\"\"\n {\n \"age\": 24,\n \"name\": \"Donggun LEE\"\n }\n \"\"\"\n ```\n - Config Object Example\n ```python\n # Config Object Example\n print(\"Config Object Example\")\n\n cfg_obj = Config(Test())\n print(cfg_class)\n \"\"\"\n {\n \"age\": 24,\n \"name\": \"Donggun LEE\"\n }\n \"\"\"\n ```\n\n", "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/Sotaneum/ConfigHelper", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ConfigHelper", "package_url": "https://pypi.org/project/ConfigHelper/", "platform": "", "project_url": "https://pypi.org/project/ConfigHelper/", "project_urls": { "Homepage": "https://github.com/Sotaneum/ConfigHelper" }, "release_url": "https://pypi.org/project/ConfigHelper/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Can use it to save or recall preferences from Python.", "version": "0.0.3" }, "last_serial": 5348075, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "867ae6736e0c3290de3d94603a2aa84a", "sha256": "31c1db5401bc75e7897ecc979149a300f7cc806787bbf3d685a5062eb2a798b4" }, "downloads": -1, "filename": "confighelper-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "867ae6736e0c3290de3d94603a2aa84a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4598, "upload_time": "2019-06-01T15:47:21", "url": "https://files.pythonhosted.org/packages/de/ef/aaf3667dab4db8b8dfcf92303925bd52b53a3295a203912b58e60d185d22/confighelper-0.0.1-py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4ecc2773cf70bb320248b76587d00a07", "sha256": "a9595bf347f78f2c385730a16b5ea6fe21c0654a4bf7888e1fade247e4daa328" }, "downloads": -1, "filename": "ConfigHelper-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4ecc2773cf70bb320248b76587d00a07", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4618, "upload_time": "2019-06-02T06:20:35", "url": "https://files.pythonhosted.org/packages/b1/10/fe0f09b9b09eac4c72c6c6c1c76fb660b7c2c45de84ddcc20eaec4caf284/ConfigHelper-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "86b77a073264cc1b69ec5097651009a6", "sha256": "7873f6bd840e622258eaec2d58d004363522c081312be4acdd1b318966a17071" }, "downloads": -1, "filename": "ConfigHelper-0.0.2.tar.gz", "has_sig": false, "md5_digest": "86b77a073264cc1b69ec5097651009a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4417, "upload_time": "2019-06-02T06:20:36", "url": "https://files.pythonhosted.org/packages/ff/fd/35b26a5042d7666845003ed00a359462ac92eba0ab7f6192b665a99f94ae/ConfigHelper-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "84761d5ae7b98426418cc1d03ebcfbaf", "sha256": "6525cfe07788e96bed1c2bb9e42fee5de0970c77b6b118de8d34937e7ff5d904" }, "downloads": -1, "filename": "ConfigHelper-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "84761d5ae7b98426418cc1d03ebcfbaf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4630, "upload_time": "2019-06-02T07:17:36", "url": "https://files.pythonhosted.org/packages/a8/6d/1f374fd89c97918c36ea508fd2186176c12f110a891d07541de080164fce/ConfigHelper-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7a67f413704c6b74b339d5f88ae172f", "sha256": "99361922e0d36d7918221f0f43dd9e1eedac2b3972eec366f1b9c86ab97b830a" }, "downloads": -1, "filename": "ConfigHelper-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a7a67f413704c6b74b339d5f88ae172f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4401, "upload_time": "2019-06-02T07:17:38", "url": "https://files.pythonhosted.org/packages/9d/b3/2fc4ad13cd744ca1b2884a64f6db0857b5e50fb4ab3e14514cfcf3065abf/ConfigHelper-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "84761d5ae7b98426418cc1d03ebcfbaf", "sha256": "6525cfe07788e96bed1c2bb9e42fee5de0970c77b6b118de8d34937e7ff5d904" }, "downloads": -1, "filename": "ConfigHelper-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "84761d5ae7b98426418cc1d03ebcfbaf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4630, "upload_time": "2019-06-02T07:17:36", "url": "https://files.pythonhosted.org/packages/a8/6d/1f374fd89c97918c36ea508fd2186176c12f110a891d07541de080164fce/ConfigHelper-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7a67f413704c6b74b339d5f88ae172f", "sha256": "99361922e0d36d7918221f0f43dd9e1eedac2b3972eec366f1b9c86ab97b830a" }, "downloads": -1, "filename": "ConfigHelper-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a7a67f413704c6b74b339d5f88ae172f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4401, "upload_time": "2019-06-02T07:17:38", "url": "https://files.pythonhosted.org/packages/9d/b3/2fc4ad13cd744ca1b2884a64f6db0857b5e50fb4ab3e14514cfcf3065abf/ConfigHelper-0.0.3.tar.gz" } ] }