{ "info": { "author": "microcoder", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "# ConfigRW\n\nConfigRW is a simple python module which read and write config files based on key-value or INI-structure.\n\n## Key features\n\n* Maximum preserves formatting of the source file (indents, spaces, comments, etc)\n* Support non-section (for access for simple config files based on key-value)\n* Inserting an option on an arbitrary string in the section\n* Support multiple values of option\n* Support options without values\n* Support comments in a section\n* Support indentation for options, values\n* Secure file rewriting. Using *.new file on write, then renamed to original filename\n\n## Installation\n\nInstallation package to user python-library directory:\n\n```bash\n$ pip install --user configrw\n```\n\nOr you can install package to global system directory of python libraries (not recommended):\n\n```bash\n$ sudo pip install configrw\n```\n\n## Documentation\n\nYou can find a full manual on how to use ConfigRW at [readthedocs](https://configrw.readthedocs.io)\n\n## Quick start\n\nIn next examples we will use the following INI file:\n\n```ini\n# This is comment\nthis is option = this is value\nsecond option = -100\n\n[ SECTION1 ] # comment\n option1 = 100\n option2 = 200\n # comment\n option3 = 1.2\n\n[ section2 ]\n param1 = 'str'\n param2 = 0 # comment\n parameter_without_value\n\n[section3]\n extensions =\n # comment1\n ext1\n # comment2\n ext2\n ext3\n```\n\n### Access to non-section area\n\nThis is features needed if you want use simple key-value of config file\n\n```python\nfrom configrw import Config\n\nconfig = Config.from_file('/path/to/file')\n\nsection = config[None] # Getting non-section\nvalue = section['this is option'] # Getting the value\nsection['this is option'] = None # Setting the value\ndel section['second option'] # Deleting the option\n```\n\n### Access to section area\n\nThis is features needed if you want use INI config file\n\n```python\nvalue = config['SECTION1']['option2'] # Getting the value\nconfig['SECTION1']['option2'] = 0 # Setting the value\nconfig['SECTION1']['option3'] = 300 # Adding new option to section\n\nconfig['section3']['extensions'].append('ext4') # Adding new value to multiple values\nconfig['section3']['extensions'].insert('ext0', 0) # Inserting new value\nconfig['section3']['extensions'][0] = 'extension0' # Changing single value of multiple values\n\nconfig.write('/path/to/file') # Saving config to file\n\n# Render config to screen\nfor line in config.to_text():\n print(line)\n```\n\nINI-file after changes:\n\n```ini\n# This is comment\nthis is option\n\n[ SECTION1 ] # comment\n option1 = 100\n option2 = 0\n # comment\n option3 = 300\n\n[ section2 ]\n param1 = 'str'\n param2 = 0 # comment\n parameter_without_value\n\n[section3]\n extensions =\n extension0\n # comment1\n ext1\n # comment2\n ext2\n ext3\n ext4\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/microcoder/configrw", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "configrw", "package_url": "https://pypi.org/project/configrw/", "platform": "", "project_url": "https://pypi.org/project/configrw/", "project_urls": { "Homepage": "https://github.com/microcoder/configrw" }, "release_url": "https://pypi.org/project/configrw/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "ConfigRW is a simple reader and writer config files based on key-value or INI-structure.", "version": "1.1.0" }, "last_serial": 5235879, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5fd3cec8b08cc96fd447b9e2eca9cafb", "sha256": "dfb297946aa55a5ea5655b46483f25cf32f1af179199f16ecbea139c49522f69" }, "downloads": -1, "filename": "configrw-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5fd3cec8b08cc96fd447b9e2eca9cafb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5426, "upload_time": "2019-04-10T14:56:51", "url": "https://files.pythonhosted.org/packages/39/b8/17eee8806b87754188015801bfd23b50a2ef67a049f919e62da4b1cff4bb/configrw-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "ca3d9d0e9f2fcba41f5e4ac436eb245a", "sha256": "7874e5c4ae48c19af945f6ad1cc9a713e56911f0ca5b77e8a12c99106101bcff" }, "downloads": -1, "filename": "configrw-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ca3d9d0e9f2fcba41f5e4ac436eb245a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5508, "upload_time": "2019-05-07T03:18:28", "url": "https://files.pythonhosted.org/packages/0d/77/4cca6c5aabaaee9224d533199026cb9af7e287870ee0d73445cd9282ca99/configrw-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ca3d9d0e9f2fcba41f5e4ac436eb245a", "sha256": "7874e5c4ae48c19af945f6ad1cc9a713e56911f0ca5b77e8a12c99106101bcff" }, "downloads": -1, "filename": "configrw-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ca3d9d0e9f2fcba41f5e4ac436eb245a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5508, "upload_time": "2019-05-07T03:18:28", "url": "https://files.pythonhosted.org/packages/0d/77/4cca6c5aabaaee9224d533199026cb9af7e287870ee0d73445cd9282ca99/configrw-1.1.0.tar.gz" } ] }