{ "info": { "author": "Shubham Chaudhary", "author_email": "me@shubhamchaudhary.in", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. image:: https://travis-ci.org/shubhamchaudhary/configparser2.svg?branch=master\n :target: https://travis-ci.org/shubhamchaudhary/configparser2\n.. image:: https://coveralls.io/repos/shubhamchaudhary/configparser2/badge.svg\n :target: https://coveralls.io/r/shubhamchaudhary/configparser2\n.. image:: https://badge.waffle.io/shubhamchaudhary/configparser2.png?label=ready&title=Ready \n :target: https://waffle.io/shubhamchaudhary/configparser2\n :alt: 'Stories in Ready'\n.. image:: https://img.shields.io/pypi/v/configparser2.svg\n :target: https://pypi.python.org/pypi/configparser2\n.. image:: https://img.shields.io/github/tag/shubhamchaudhary/configparser2.svg\n.. image:: https://img.shields.io/github/release/shubhamchaudhary/configparser2.svg\n \n=============\nconfigparser2\n=============\n\nconfigparser2 is derived from Lukasz Langa's configparser mercurial repo. The\nonly difference is a name is not conflicting with the default python3\nconfigparser. \n\nSource Code\n~~~~~~~~~~~\n\nSource Code for configparser2 is on \n`Github `_.\n\n\nInstallation\n~~~~~~~~~~~~\n\nA quick ``pip install configparser2`` should do the job.\n\n\nDocs for configparser\n~~~~~~~~~~~~~~~~~~~~~\n\n\nThe ancient ``ConfigParser`` module available in the standard library 2.x has\nseen a major update in Python 3.2. This is a backport of those changes so that\nthey can be used directly in Python 2.6 - 3.5.\n\nTo use the ``configparser2`` backport instead of the built-in version on both\nPython 2 and Python 3, simply import it explicitly as a backport::\n\n from backports import configparser2\n\nIf you'd like to use the backport on Python 2 and the built-in version on\nPython 3, use that invocation instead::\n\n import configparser2\n\nFor detailed documentation consult the vanilla version at\nhttp://docs.python.org/3/library/configparser2.html.\n\nWhy you'll love ``configparser2``\n---------------------------------\n\nWhereas almost completely compatible with its older brother, ``configparser2``\nsports a bunch of interesting new features:\n\n* full mapping protocol access (`more info\n `_)::\n\n >>> parser = ConfigParser()\n >>> parser.read_string(\"\"\"\n [DEFAULT]\n location = upper left\n visible = yes\n editable = no\n color = blue\n\n [main]\n title = Main Menu\n color = green\n\n [options]\n title = Options\n \"\"\")\n >>> parser['main']['color']\n 'green'\n >>> parser['main']['editable']\n 'no'\n >>> section = parser['options']\n >>> section['title']\n 'Options'\n >>> section['title'] = 'Options (editable: %(editable)s)'\n >>> section['title']\n 'Options (editable: no)'\n\n* there's now one default ``ConfigParser`` class, which basically is the old\n ``SafeConfigParser`` with a bunch of tweaks which make it more predictable for\n users. Don't need interpolation? Simply use\n ``ConfigParser(interpolation=None)``, no need to use a distinct\n ``RawConfigParser`` anymore.\n\n* the parser is highly `customizable upon instantiation\n `__\n supporting things like changing option delimiters, comment characters, the\n name of the DEFAULT section, the interpolation syntax, etc.\n\n* you can easily create your own interpolation syntax but there are two powerful\n implementations built-in (`more info\n `__):\n\n * the classic ``%(string-like)s`` syntax (called ``BasicInterpolation``)\n\n * a new ``${buildout:like}`` syntax (called ``ExtendedInterpolation``)\n\n* fallback values may be specified in getters (`more info\n `__)::\n\n >>> config.get('closet', 'monster',\n ... fallback='No such things as monsters')\n 'No such things as monsters'\n\n* ``ConfigParser`` objects can now read data directly `from strings\n `__\n and `from dictionaries\n `__.\n That means importing configuration from JSON or specifying default values for\n the whole configuration (multiple sections) is now a single line of code. Same\n goes for copying data from another ``ConfigParser`` instance, thanks to its\n mapping protocol support.\n\n* many smaller tweaks, updates and fixes\n\nA few words about Unicode\n-------------------------\n\n``configparser2`` comes from Python 3 and as such it works well with Unicode.\nThe library is generally cleaned up in terms of internal data storage and\nreading/writing files. There are a couple of incompatibilities with the old\n``ConfigParser`` due to that. However, the work required to migrate is well\nworth it as it shows the issues that would likely come up during migration of\nyour project to Python 3.\n\nThe design assumes that Unicode strings are used whenever possible [1]_. That\ngives you the certainty that what's stored in a configuration object is text.\nOnce your configuration is read, the rest of your application doesn't have to\ndeal with encoding issues. All you have is text [2]_. The only two phases when\nyou should explicitly state encoding is when you either read from an external\nsource (e.g. a file) or write back.\n\nVersioning\n----------\n\nThis backport is intended to keep 100% compatibility with the vanilla release in\nPython 3.2+. To help maintaining a version you want and expect, a versioning\nscheme is used where:\n\n* the first two numbers indicate the version of Python 3 from which the\n backport is done\n\n* a backport release number is provided as the final number (zero-indexed)\n\nFor example, ``3.5.2`` is the **third** backport release of the\n``configparser2`` library as seen in Python 3.5. Note that ``3.5.2`` does\n**NOT** necessarily mean this backport version is based on the standard library\nof Python 3.5.2.\n\nOne exception from the 100% compatibility principle is that bugs fixed before\nreleasing another minor Python 3 bugfix version **will be included** in the\nbackport releases done in the mean time.\n\nMaintenance\n-----------\n\nThis backport is maintained on BitBucket by \u0141ukasz Langa, the current vanilla\n``configparser2`` maintainer for CPython:\n\n* `configparser2 git repository `_\n\n* `configparser2 Mercurial repository `_\n\n* `configparser2 issue tracker `_\n\nChange Log\n----------\n\n4.0.0\n~~~~~\n\n* Change name to configparser2\n\n\n3.5.0\n~~~~~\n\n* a complete rewrite of the backport; now single codebase working on Python\n 2.6 - 3.5. To use on Python 3 import ``from backports import configparser2``\n instead of the built-in version.\n\n* compatible with 3.4.1 + fixes for `#19546\n `_\n\n* fixes `BitBucket issue #1\n `_: versioning non-compliant\n with PEP 386\n\n* fixes `BitBucket issue #3\n `_: ``reload(sys);\n sys.setdefaultencoding('utf8')`` in setup.py\n\n* fixes `BitBucket issue #5\n `_: Installing the backport\n on Python 3 breaks virtualenv\n\n* fixes `BitBucket issue #6\n `_: PyPy compatibility\n\n3.5.0b2\n~~~~~~~\n\n* second beta of 3.5.0, not using any third-party futurization libraries\n\n3.5.0b1\n~~~~~~~\n\n* first beta of 3.5.0, using python-future\n\n* for the full feature list, see `3.5.0`_\n\n3.3.0r2\n~~~~~~~\n\n* updated the fix for `#16820 `_: parsers\n now preserve section order when using ``__setitem__`` and ``update``\n\n3.3.0r1\n~~~~~~~\n\n* compatible with 3.3.0 + fixes for `#15803\n `_ and `#16820\n `_\n\n* fixes `BitBucket issue #4\n `_: ``read()`` properly\n treats a bytestring argument as a filename\n\n* `ordereddict `_ dependency required\n only for Python 2.6\n\n* `unittest2 `_ explicit dependency\n dropped. If you want to test the release, add ``unittest2`` on your own.\n\n3.2.0r3\n~~~~~~~\n\n* proper Python 2.6 support\n\n * explicitly stated the dependency on `ordereddict\n `_\n\n * numbered all formatting braces in strings\n\n* explicitly says that Python 2.5 support won't happen (too much work necessary\n without abstract base classes, string formatters, the ``io`` library, etc.)\n\n* some healthy advertising in the README\n\n3.2.0r2\n~~~~~~~\n\n* a backport-specific change: for convenience and basic compatibility with the\n old ConfigParser, bytestrings are now accepted as section names, options and\n values. Those strings are still converted to Unicode for internal storage so\n in any case when such conversion is not possible (using the 'ascii' codec),\n UnicodeDecodeError is raised.\n\n3.2.0r1\n~~~~~~~\n\n* the first public release compatible with 3.2.0 + fixes for `#11324\n `_, `#11670\n `_ and `#11858\n `_.\n\nConversion Process\n------------------\n\nThis section is technical and should bother you only if you are wondering how\nthis backport is produced. If the implementation details of this backport are\nnot important for you, feel free to ignore the following content.\n\n``configparser2`` is converted using `python-future\n`_ and free time. Because a fully automatic\nconversion was not doable, I took the following branching approach:\n\n* the ``3.x`` branch holds unchanged files synchronized from the upstream\n CPython repository. The synchronization is currently done by manually copying\n the required files and stating from which CPython changeset they come from.\n\n* the ``default`` branch holds a version of the ``3.x`` code with some tweaks\n that make it independent from libraries and constructions unavailable on 2.x.\n Code on this branch still *must* work on the corresponding Python 3.x but\n will also work on Python 2.6 and 2.7 (including PyPy). You can check this\n running the supplied unit tests with ``tox``.\n\nThe process works like this:\n\n1. I update the ``3.x`` branch with new versions of files. Commit.\n\n2. I merge the new commit to ``default``. I run ``tox``. Commit.\n\n3. If there are necessary changes, I do them now (on ``default``). Note that\n the changes should be written in the syntax subset supported by Python\n 2.6.\n\n4. I run ``tox``. If it works, I update the docs and release the new version.\n Otherwise, I go back to point 3. I might use ``pasteurize`` to suggest me\n required changes but usually I do them manually to keep resulting code in\n a nicer form.\n\n\nFootnotes\n---------\n\n.. [1] To somewhat ease migration, passing bytestrings is still supported but\n they are converted to Unicode for internal storage anyway. This means\n that for the vast majority of strings used in configuration files, it\n won't matter if you pass them as bytestrings or Unicode. However, if you\n pass a bytestring that cannot be converted to Unicode using the naive\n ASCII codec, a ``UnicodeDecodeError`` will be raised. This is purposeful\n and helps you manage proper encoding for all content you store in\n memory, read from various sources and write back.\n\n.. [2] Life gets much easier when you understand that you basically manage\n **text** in your application. You don't care about bytes but about\n letters. In that regard the concept of content encoding is meaningless.\n The only time when you deal with raw bytes is when you write the data to\n a file. Then you have to specify how your text should be encoded. On\n the other end, to get meaningful text from a file, the application\n reading it has to know which encoding was used during its creation. But\n once the bytes are read and properly decoded, all you have is text. This\n is especially powerful when you start interacting with multiple data\n sources. Even if each of them uses a different encoding, inside your\n application data is held in abstract text form. You can program your\n business logic without worrying about which data came from which source.\n You can freely exchange the data you store between sources. Only\n reading/writing files requires encoding your text to bytes.", "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/shubhamchaudhary/configparser2", "keywords": "configparser configparser2 ini parsing conf cfg configuration file", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "configparser2", "package_url": "https://pypi.org/project/configparser2/", "platform": "any", "project_url": "https://pypi.org/project/configparser2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/shubhamchaudhary/configparser2" }, "release_url": "https://pypi.org/project/configparser2/4.0.0/", "requires_dist": null, "requires_python": null, "summary": "This library brings the updated configparser from Python 3.5 to Python 2.6-3.5.", "version": "4.0.0" }, "last_serial": 1544864, "releases": { "4.0.0": [ { "comment_text": "", "digests": { "md5": "60018f99cae0c4f43864352c576ea52d", "sha256": "d22444d117d1889e7c0f040c6c1d02f56bc58a5c2040c5c056cad828f212b16f" }, "downloads": -1, "filename": "configparser2-4.0.0.tar.gz", "has_sig": false, "md5_digest": "60018f99cae0c4f43864352c576ea52d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21811, "upload_time": "2015-05-12T20:29:56", "url": "https://files.pythonhosted.org/packages/15/7d/23899ba6f88302c5619a2e81529c5944ccdf5becfe5b72bc6b97449cdf8b/configparser2-4.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "60018f99cae0c4f43864352c576ea52d", "sha256": "d22444d117d1889e7c0f040c6c1d02f56bc58a5c2040c5c056cad828f212b16f" }, "downloads": -1, "filename": "configparser2-4.0.0.tar.gz", "has_sig": false, "md5_digest": "60018f99cae0c4f43864352c576ea52d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21811, "upload_time": "2015-05-12T20:29:56", "url": "https://files.pythonhosted.org/packages/15/7d/23899ba6f88302c5619a2e81529c5944ccdf5becfe5b72bc6b97449cdf8b/configparser2-4.0.0.tar.gz" } ] }