{ "info": { "author": "Anthony Fu", "author_email": "anthonyfu117@hotmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "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.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development" ], "description": "Biconfigs\r\n=========\r\n\r\n|Build Status| |Coverage| |Codacy grade| |Python Version| |PyPI| |PyPI\r\nStatus| |License|\r\n\r\n\ud83d\udcc4\u21c4\ud83d\udee0 Two way configurations mapping helper for Python.\r\n\r\nGet Started\r\n-----------\r\n\r\n.. code:: python\r\n\r\n from biconfigs import Biconfigs\r\n configs = Biconfigs('configs.json')\r\n\r\n # Simply change the dict, and it will automatically save the changes to file.\r\n configs['options'] = {'debug': True,\r\n 'username': 'Anthony',\r\n 'list': [] }\r\n\r\n # Access with simple 'x.y.z' style\r\n configs.options.list.append('example')\r\n\r\nContent of file ``configs.json`` after execution:\r\n\r\n.. code:: json\r\n\r\n {\r\n \"options\": {\r\n \"debug\": true,\r\n \"list\": [\r\n \"example\"\r\n ],\r\n \"username\": \"Anthony\"\r\n }\r\n }\r\n\r\n\\* *Biconfigs also supports `CSON <#cson>`__ and `YAML <#yaml>`__ file\r\nformats.*\r\n\r\nInstall\r\n-------\r\n\r\n.. code:: sh\r\n\r\n pip install biconfigs\r\n\r\nDependencies\r\n------------\r\n\r\n**No dependencies** required \ud83c\udf89\r\n\r\nTested on Python ``2.6``, ``2.7``, ``3.3``, ``3.4``, ``3.5``, ``pypy``,\r\n``pypy3``\r\n\r\nDocumentation\r\n-------------\r\n\r\nWhen to save\r\n~~~~~~~~~~~~\r\n\r\n- Saving when: *Item create, item delete, list reorder, value change,\r\n ``setdefault``, etc.*\r\n\r\n .. code:: python\r\n\r\n # All the following single statement will cause saving\r\n configs['item'] = 'value'\r\n configs['options'] = {}\r\n configs.options['list'] = []\r\n configs.options.list.append('example')\r\n configs.options['list'] = []\r\n configs.options.clear()\r\n value2 = configs.setdefault('item2', 45)\r\n\r\n- Not saving when: *Item access, assignment but not changed, etc.*\r\n\r\n .. code:: python\r\n\r\n # All the following single statement will NOT cause saving\r\n value = configs.item\r\n configs['item'] = 'value' # The value of 'item' is not changed\r\n value3 = configs.get('item_not_exists', 'default_value')\r\n\r\nNon-blocking saving\r\n~~~~~~~~~~~~~~~~~~~\r\n\r\nBy default, Biconfigs use asynchronous saving. You can disable the\r\nfeature by setting ``async_write`` to ``False``\r\n\r\n.. code:: python\r\n\r\n # set \"async_write=False\" if your want to use synchronous saving\r\n # to ensure your data saved to file in time,\r\n # WARNING: In sync mode, your changes will block the incoming statement\r\n # until the file correctly saved.\r\n configs = Biconfigs('configs.json', async_write=False)\r\n\r\n configs['item'] = 'value' # Blocking\r\n # Configure file saved already\r\n\r\n # Your code...\r\n\r\nHigh frequency update\r\n~~~~~~~~~~~~~~~~~~~~~\r\n\r\nNormally, Biconfigs will write the changes to file immediately. But\r\nsometime you may want to update values frequently, which will result in\r\na IO bottleneck. So you can use **``with``** statement to prevent auto\r\nsaving for a while.\r\n\r\n.. code:: python\r\n\r\n with configs:\r\n for i in range(1000):\r\n configs['some_key'] = i\r\n # This statement will execute saving process only one time when exiting \"with\" scope\r\n\r\nReload from file\r\n~~~~~~~~~~~~~~~~\r\n\r\nSimply use ``reload`` function to reload from file. *Note*: ``reload``\r\nwill discard all present data in Biconfigs-object and loads new ones\r\nfrom file)\r\n\r\n.. code:: python\r\n\r\n configs.reload()\r\n\r\nParsers\r\n~~~~~~~\r\n\r\nBiconfigs use ``Prettified Json`` as default parser. You may want to set\r\n``parser='json'`` to save as compacted json file.\r\n\r\n.. code:: python\r\n\r\n configs = Biconfigs('configs.json', parser='json')\r\n configs['item'] = 'value'\r\n configs['debug'] = False\r\n\r\nconfigs.json:\r\n\r\n.. code:: json\r\n\r\n {\"debug\": false, \"item\": \"value\"}\r\n\r\n**Available Parsers**\r\n\r\n- ``json``: Compact JSON format\r\n- ``pretty-json``: Prettified JSON\r\n- ``cson``: CSON format, refer to `CSON <#cson>`__\r\n- ``yaml``: YAML format, refer to `YAML <#yaml>`__\r\n\r\nCSON\r\n----\r\n\r\nBiconfigs supports `CSON `__ by\r\n`avakar/pycson `__\r\n\r\n.. code:: python\r\n\r\n from biconfigs import Biconfigs\r\n from biconfigs import parser_cson\r\n\r\n configs = Biconfigs('configs.cson', parser='cson')\r\n # Then use biconfigs as you normally would...\r\n\r\n**Extra requirements**\r\n\r\nTo use CSON, you need to install extra requirement\r\n\r\n.. code:: sh\r\n\r\n pip install biconfigs[cson]\r\n\r\nOr install ``cson`` manually:\r\n\r\n.. code:: sh\r\n\r\n pip install cson\r\n\r\n**CSON problems**\r\n\r\nPlease check `avakar/pycson: The\r\nLanguage `__\r\n\r\nYAML\r\n----\r\n\r\nBiconfigs supports `YAML `__ by\r\n`PyYAML `__\r\n\r\n.. code:: python\r\n\r\n from biconfigs import Biconfigs\r\n from biconfigs import parser_yaml\r\n\r\n configs = Biconfigs('configs.yml', parser='yaml')\r\n # Then use biconfigs as you normally would...\r\n\r\n**Extra requirements**\r\n\r\nTo use YAML, you need to install extra requirement\r\n\r\n.. code:: sh\r\n\r\n pip install biconfigs[yaml]\r\n\r\nOr install ``PyYAML`` manually:\r\n\r\n.. code:: sh\r\n\r\n pip install PyYAML\r\n\r\nLicense\r\n-------\r\n\r\nMIT\r\n\r\n.. |Build Status| image:: https://img.shields.io/travis/antfu/biconfigs.svg?style=flat-square\r\n :target: https://travis-ci.org/antfu/biconfigs\r\n.. |Coverage| image:: https://img.shields.io/codecov/c/github/antfu/biconfigs.svg?style=flat-square\r\n :target: https://codecov.io/gh/antfu/biconfigs\r\n.. |Codacy grade| image:: https://img.shields.io/codacy/grade/4bf188eecc374c76b5c6ddbe93315078.svg?style=flat-square\r\n :target: https://www.codacy.com/app/anthonyfu117/biconfigs/dashboard\r\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/biconfigs.svg?style=flat-square\r\n :target: https://pypi.python.org/pypi/biconfigs\r\n.. |PyPI| image:: https://img.shields.io/pypi/v/biconfigs.svg?style=flat-square\r\n :target: https://pypi.python.org/pypi/biconfigs\r\n.. |PyPI Status| image:: https://img.shields.io/pypi/status/biconfigs.svg?style=flat-square\r\n :target: https://pypi.python.org/pypi/biconfigs\r\n.. |License| image:: https://img.shields.io/pypi/l/biconfigs.svg?style=flat-square\r\n :target: https://github.com/antfu/biconfigs/blob/master/LICENSE", "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/antfu/biconfigs", "keywords": "config,configuration,json", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "biconfigs", "package_url": "https://pypi.org/project/biconfigs/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/biconfigs/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/antfu/biconfigs" }, "release_url": "https://pypi.org/project/biconfigs/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "Two way configurations mapping helper for Python.", "version": "0.1.3" }, "last_serial": 2393195, "releases": { "0.0.10": [ { "comment_text": "", "digests": { "md5": "3802603f255de311a005176ec5ada510", "sha256": "dd39d2c5e5fe0e58a3f3130b2cf7b4529ce17401518cae7e7801f63b289728c3" }, "downloads": -1, "filename": "biconfigs-0.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "3802603f255de311a005176ec5ada510", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 4447, "upload_time": "2016-09-28T10:17:54", "url": "https://files.pythonhosted.org/packages/58/b0/287583bf25535e65f147f4fafb37fce2e755714b5aef96b6aaad6557dbf4/biconfigs-0.0.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e2705758590dbb3c582ff5788fee8ad0", "sha256": "8d1810bd48c86d8d4818782e6cf2c925a1f9c3a7f47e7e46e73297f657a7f8b6" }, "downloads": -1, "filename": "biconfigs-0.0.10.zip", "has_sig": false, "md5_digest": "e2705758590dbb3c582ff5788fee8ad0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8104, "upload_time": "2016-09-28T10:17:51", "url": "https://files.pythonhosted.org/packages/63/f6/3da036206928a0c620727cc62094d4e6e31440f4657df424bb652e4c24ad/biconfigs-0.0.10.zip" } ], "0.0.11": [], "0.0.12": [ { "comment_text": "", "digests": { "md5": "cb38695545b67472603648785588df58", "sha256": "cd4f29878316bd04f1f2abd19795084a9c7b3759fe8b401691614c4cc845dfae" }, "downloads": -1, "filename": "biconfigs-0.0.12-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cb38695545b67472603648785588df58", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 4450, "upload_time": "2016-09-28T12:01:12", "url": "https://files.pythonhosted.org/packages/93/a2/e3f1e137c803b9b5c2db71f5c30e5129e060e596698f1ef61d6c46d2e2cb/biconfigs-0.0.12-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e52af24742fa671212540dd58c75d9b9", "sha256": "03fe7d3d4a4c8883ef1ebcd5a236e2e7de9ba40761332667a23a48768018e3cb" }, "downloads": -1, "filename": "biconfigs-0.0.12.zip", "has_sig": false, "md5_digest": "e52af24742fa671212540dd58c75d9b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9930, "upload_time": "2016-09-28T12:01:08", "url": "https://files.pythonhosted.org/packages/a2/d8/d983123f1665c33cfd33e4e1d413761cce87345e18dd50c277c58029e83d/biconfigs-0.0.12.zip" } ], "0.0.14": [ { "comment_text": "", "digests": { "md5": "5f39ab1c996859e47d844aa4cd278028", "sha256": "09d721852749ea7782c358cd323afbdc2a5e75f1690865fde5be44b021b84b95" }, "downloads": -1, "filename": "biconfigs-0.0.14-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5f39ab1c996859e47d844aa4cd278028", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 4996, "upload_time": "2016-09-29T14:28:39", "url": "https://files.pythonhosted.org/packages/92/30/b7c3ce1af0b3aef89ab5737b6dece0aaac89af1cd61e92dcdd4f8152c611/biconfigs-0.0.14-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1f2c52a648299448f9bd673cda41d131", "sha256": "9619f18ef04d221a932d9772af2f3250a9d36e8b9d5dad01bc7259a99ed5d0c0" }, "downloads": -1, "filename": "biconfigs-0.0.14.zip", "has_sig": false, "md5_digest": "1f2c52a648299448f9bd673cda41d131", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10812, "upload_time": "2016-09-29T14:28:36", "url": "https://files.pythonhosted.org/packages/66/42/4ec907441d1eb1bed60d661b9dcede7e8dfa88feb9171e5037c8078df6b4/biconfigs-0.0.14.zip" } ], "0.0.15": [ { "comment_text": "", "digests": { "md5": "26b6f4ae81e14274736bc48ed3987a67", "sha256": "0285f27c51bd24bcd33f6c69eb3b61a561d243b6f08be8142ae19d6210ac1f71" }, "downloads": -1, "filename": "biconfigs-0.0.15-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "26b6f4ae81e14274736bc48ed3987a67", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 5384, "upload_time": "2016-09-29T16:07:30", "url": "https://files.pythonhosted.org/packages/1b/77/a36eacb54cebf25fcf704aeda003a30a3bf74672e6ba520abc0136b8d67b/biconfigs-0.0.15-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dc9bbcaabd3b947fa2eac828cde3c91b", "sha256": "c6685899223628d4353e5939ded5d89742c00b06cd3d9413176dcdb2d5fe8eec" }, "downloads": -1, "filename": "biconfigs-0.0.15.zip", "has_sig": false, "md5_digest": "dc9bbcaabd3b947fa2eac828cde3c91b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12695, "upload_time": "2016-09-29T16:07:26", "url": "https://files.pythonhosted.org/packages/c4/99/dd94073e28006452410d91389f05be80ce743beb2adc2c2f9ef65013f900/biconfigs-0.0.15.zip" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "4081faa758b06d40bd848a6dedf7eb34", "sha256": "7cf93ccc6a99b086330d74dff52957dd9664fa29956b2f3a634cb6778e339647" }, "downloads": -1, "filename": "biconfigs-0.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "4081faa758b06d40bd848a6dedf7eb34", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 4432, "upload_time": "2016-09-28T09:38:10", "url": "https://files.pythonhosted.org/packages/c8/33/9298c3d32677e24d0063e31ae4dad76a526d20132ede56d3af046f0079bf/biconfigs-0.0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "303601f0bbb2e24bb6df5347e3e901e6", "sha256": "ca15fdb2da8cd3104b765cede8778ab59f23d05d2368777be60d0a7ed41cb851" }, "downloads": -1, "filename": "biconfigs-0.0.9.zip", "has_sig": false, "md5_digest": "303601f0bbb2e24bb6df5347e3e901e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6888, "upload_time": "2016-09-28T09:38:07", "url": "https://files.pythonhosted.org/packages/f7/32/6d0c765c0317d19fbb268617d043a92dd09806811d60f809b4250381a866/biconfigs-0.0.9.zip" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "2e42eb4c301ae35e348bb72153b715a8", "sha256": "e03aea30bd614acfa6fd1938b0fc16fc64f84fa787fc20a634e4692b07b3b485" }, "downloads": -1, "filename": "biconfigs-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e42eb4c301ae35e348bb72153b715a8", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 5810, "upload_time": "2016-09-30T20:24:44", "url": "https://files.pythonhosted.org/packages/70/a4/3e6cdf2d70f379401bbfb5b20a218f4bf59ba3a59234ba71995a604706f2/biconfigs-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "be856bf96647d3318d558ac4a1159454", "sha256": "309020ec6bafd4348ef6d88705f3fc535dc7b76346c0cdfc8f8cd20d66d4be6a" }, "downloads": -1, "filename": "biconfigs-0.1.0.zip", "has_sig": false, "md5_digest": "be856bf96647d3318d558ac4a1159454", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12790, "upload_time": "2016-09-30T20:24:41", "url": "https://files.pythonhosted.org/packages/aa/08/a94e60d39eacfccdcf3a1e95a4a675c82d714f3e11003aa9351a75c1f332/biconfigs-0.1.0.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "86c65c0f2ffdafff1ad69bb4409b7d5b", "sha256": "51468d4fd478cb9c255213eb373c4391943b47fa70987361e968167f306a7698" }, "downloads": -1, "filename": "biconfigs-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "86c65c0f2ffdafff1ad69bb4409b7d5b", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 5804, "upload_time": "2016-09-30T20:35:42", "url": "https://files.pythonhosted.org/packages/f0/12/0838f389c9084882e0004f0833f6dcddbf242dfba0d506072382b466fcf4/biconfigs-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9e0c2fd336e484fd945ffa6713ba74a5", "sha256": "154be9adff30c2b45377f2916fdd0141c1a82b0847ecdc52fe2ea530c07acaba" }, "downloads": -1, "filename": "biconfigs-0.1.1.zip", "has_sig": false, "md5_digest": "9e0c2fd336e484fd945ffa6713ba74a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12792, "upload_time": "2016-09-30T20:35:40", "url": "https://files.pythonhosted.org/packages/a6/5a/d289acef71e1a705c3008ab23323c95394367063b7c2db482d49c1c21e4a/biconfigs-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "4473e97573bad86896d5c3e4588a9d12", "sha256": "eba62e2bf02024e1f4ffd71259b45a37efc58acef7437d5a5be87e57ac7f15a9" }, "downloads": -1, "filename": "biconfigs-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4473e97573bad86896d5c3e4588a9d12", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 6840, "upload_time": "2016-10-11T10:30:48", "url": "https://files.pythonhosted.org/packages/bb/77/136ab1aa8fc7c90aed6fd28ac1367b404a0b0fc5008e16d63d15b4d0c319/biconfigs-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "99902524ea66e134421aac52a885c834", "sha256": "9e667df49252835c2a19e1614e1212bbbfd79c0e11ee28ad6ec8f8719092acea" }, "downloads": -1, "filename": "biconfigs-0.1.2.zip", "has_sig": false, "md5_digest": "99902524ea66e134421aac52a885c834", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14788, "upload_time": "2016-10-11T10:30:44", "url": "https://files.pythonhosted.org/packages/03/16/b2a83d409f6cf351c623ee55bdd9cc0f5b457e7243ee43d957dc00864108/biconfigs-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "56037c4624b6418d8e792a433ab9642b", "sha256": "269e3cccce5ae00827ba5be4bc470f3cedb0102be804bf456254c9fb61eda961" }, "downloads": -1, "filename": "biconfigs-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "56037c4624b6418d8e792a433ab9642b", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 7383, "upload_time": "2016-10-11T12:36:14", "url": "https://files.pythonhosted.org/packages/94/9c/338a94cb0dc899692139e790ad9e3847ad8f1ca63059717b463043d71861/biconfigs-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b68c520ed0098614d5f98436e666a10", "sha256": "01877437a890deb974dbd4e91f8d7bb640f0445cc5553e065ce0197585778761" }, "downloads": -1, "filename": "biconfigs-0.1.3.zip", "has_sig": false, "md5_digest": "1b68c520ed0098614d5f98436e666a10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15429, "upload_time": "2016-10-11T12:36:08", "url": "https://files.pythonhosted.org/packages/52/ea/40d2443eea412eda236a9c15f52c7952acd9f4a60335672429d755244396/biconfigs-0.1.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "56037c4624b6418d8e792a433ab9642b", "sha256": "269e3cccce5ae00827ba5be4bc470f3cedb0102be804bf456254c9fb61eda961" }, "downloads": -1, "filename": "biconfigs-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "56037c4624b6418d8e792a433ab9642b", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 7383, "upload_time": "2016-10-11T12:36:14", "url": "https://files.pythonhosted.org/packages/94/9c/338a94cb0dc899692139e790ad9e3847ad8f1ca63059717b463043d71861/biconfigs-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b68c520ed0098614d5f98436e666a10", "sha256": "01877437a890deb974dbd4e91f8d7bb640f0445cc5553e065ce0197585778761" }, "downloads": -1, "filename": "biconfigs-0.1.3.zip", "has_sig": false, "md5_digest": "1b68c520ed0098614d5f98436e666a10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15429, "upload_time": "2016-10-11T12:36:08", "url": "https://files.pythonhosted.org/packages/52/ea/40d2443eea412eda236a9c15f52c7952acd9f4a60335672429d755244396/biconfigs-0.1.3.zip" } ] }