{ "info": { "author": "Hearsay Social", "author_email": "opensource@hearsaysocial.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "========\nrichenum\n========\n.. image:: https://travis-ci.org/hearsaycorp/richenum.png\n :alt: Build Status\n :target: https://travis-ci.org/#!/hearsaycorp/richenum/\n\n.. image:: https://img.shields.io/pypi/v/richenum.svg\n :alt: Latest PyPI Version\n :target: https://pypi.python.org/pypi/richenum/\n\n=====\nAbout\n=====\nA enum library for Python.\n\nenum\n A simple enum implementation that maps a \"variable\" to a constant.\nRichEnum\n An enum implementation that offers more functionality than a basic enum, hence the\n name: RichEnum. Provided functionality include specifying a canonical name and a display name.\n The canonical name should be used if you need to do a lookup or reference in your code.\n The display name should be used if you need to display text to a user.\nOrderedRichEnum\n Exactly like RichEnum but also has an index specified for each enum value. Also, iteration over\n an OrderedRichEnum will be sorted (ascending) by the enum value's index.\n\n-----\nLinks\n-----\n| `GitHub `_\n| `PyPi `_\n| `Blog post about the motivation behind RichEnum `_\n\n============\nInstallation\n============\n.. code:: bash\n\n $ pip install richenum\n\n=====\nExample Usage\n=====\n----\nenum\n----\n.. code:: python\n\n >>> from richenum import enum\n >>> MY_ENUM = enum(FOO=1, BAR=2)\n >>> MY_ENUM.FOO\n 1\n >>> MY_ENUM.BAR\n 2\n\n--------\nRichEnum\n--------\n.. code:: python\n\n >>> from richenum import RichEnum, RichEnumValue\n >>> class MyRichEnum(RichEnum):\n ... FOO = RichEnumValue(canonical_name=\"foo\", display_name=\"Foo\")\n ... BAR = RichEnumValue(canonical_name=\"bar\", display_name=\"Bar\")\n ...\n >>> MyRichEnum.FOO\n RichEnumValue - canonical_name: 'foo' display_name: 'Foo'\n >>> MyRichEnum.from_canonical(\"foo\")\n RichEnumValue - canonical_name: 'foo' display_name: 'Foo'\n\n\n---------------\nOrderedRichEnum\n---------------\n.. code:: python\n\n >>> from richenum import OrderedRichEnum, OrderedRichEnumValue\n >>> class MyOrderedRichEnum(OrderedRichEnum):\n ... FOO = OrderedRichEnumValue(index=1, canonical_name=\"foo\", display_name=\"Foo\")\n ... BAR = OrderedRichEnumValue(index=2, canonical_name=\"bar\", display_name=\"Bar\")\n ...\n >>> MyOrderedRichEnum.FOO\n OrderedRichEnumValue - idx: 1 canonical_name: 'foo' display_name: 'Foo'\n >>> MyOrderedRichEnum.from_canonical(\"foo\")\n OrderedRichEnumValue - idx: 1 canonical_name: 'foo' display_name: 'Foo'\n >>> MyOrderedRichEnum.from_index(1)\n OrderedRichEnumValue - idx: 1 canonical_name: 'foo' display_name: 'Foo'\n\n\n================\nRelated Packages\n================\n\ndjango-richenum\n Makes RichEnum and OrderedRichEnum available in as model fields and form fields in Django.\n\n | `GitHub `_\n\n | `PyPi `_\n\nenum\n Starting with Python 3.4, there is a standard library for enumerations.\n This class has a similar API, but is not directly compatible with that\n class.\n\n\n============\nContributing\n============\n\n#. Fork the repo from `GitHub `_.\n#. Make your changes.\n#. Add unittests for your changes.\n#. Run `pep8 `_, `pyflakes `_, and `pylint `_ to make sure your changes follow the Python style guide and doesn't have any errors.\n#. Add yourself to the AUTHORS file (in alphabetical order).\n#. Send a pull request from your fork to the main repo.\n\n\nChangelog\n=========\n\n1.2.1 (2016-09-16)\n------------------\n - ``EnumLookupError`` class now inherits from built-in ``LookupError``.\n\n1.2.0 (2016-04-15)\n------------------\n - added simple ``LookupError`` members that are thrown when\n ``RichEnum.lookup`` is called for a nonexistent attr/val pair.\n Users can choose to catch either the specific ``LookupError`` or\n continue to catch ``EnumLookupError``.\n\n1.1.0 (2014-04-17)\n------------------\n - support for Python 3 and PyPy\n\n1.0.4 (2013-12-03)\n------------------\n - Better unicode handling in ``__str__``, ``__unicode__``, and\n ``__repr__`` magic methods.\n\n1.0.3 (2013-12-03)\n------------------\n - Stop throwing warnings.\n\n1.0.2 (2013-11-05)\n------------------\n - Suppress warnings from mismatched type comparisons when generated\n in RichEnum.lookup.\n\n1.0.1 (2013-09-20)\n------------------\n - Raise warnings when comparing enum values to other types, but not\n when checking membership or comparing to None.\n\n1.0.0 (2013-08-16)\n------------------\n - Initial public release.\n\n\nDeveloped and maintained by `Hearsay Social, Inc.\n`_.\n\nContributors\n============\n| `Adam DePue `_\n| `Akshay Shah `_\n| `Dale Hui `_\n| `Robert MacCloy `_\n| `Sam Vilain `_\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/hearsaycorp/richenum", "keywords": "python enum richenum", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "richenum", "package_url": "https://pypi.org/project/richenum/", "platform": "", "project_url": "https://pypi.org/project/richenum/", "project_urls": { "Homepage": "https://github.com/hearsaycorp/richenum" }, "release_url": "https://pypi.org/project/richenum/1.2.1/", "requires_dist": null, "requires_python": "", "summary": "Enum library for python.", "version": "1.2.1" }, "last_serial": 5748767, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fb790cbb63c0edcd63c26f3249189501", "sha256": "fdb1886bdabd625cb5fbcbc2a813d337a67aaa59f0825c44cf0c75591e1cf668" }, "downloads": -1, "filename": "richenum-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fb790cbb63c0edcd63c26f3249189501", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3915, "upload_time": "2013-07-31T22:05:23", "url": "https://files.pythonhosted.org/packages/ab/d3/355a7eca11dee3b4ea5adcc47f61c25f5a8217f48e527be763e173fc453a/richenum-0.1.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "62a2c504c9a6202f2908f2340c7d1bb9", "sha256": "f1bfc41fec43d4b1dcbeb296b6192456b898880ad9ed2a07c91ef430be300e3b" }, "downloads": -1, "filename": "richenum-1.0.0.tar.gz", "has_sig": false, "md5_digest": "62a2c504c9a6202f2908f2340c7d1bb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6177, "upload_time": "2013-09-09T20:54:50", "url": "https://files.pythonhosted.org/packages/38/b9/bc2c783b20f45cee7b3e4d5cd106781b41d3e0407bc4cfa8766703ba795c/richenum-1.0.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "ec1108ad163b05979fcadecf9edb0dfc", "sha256": "4340ba5df6f78e3de9d20a5122b3d3aee55ad73839a44378bce056b16a891e33" }, "downloads": -1, "filename": "richenum-1.0.2.tar.gz", "has_sig": false, "md5_digest": "ec1108ad163b05979fcadecf9edb0dfc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6970, "upload_time": "2013-11-05T22:54:03", "url": "https://files.pythonhosted.org/packages/78/0b/9e08ba1e786110ebbffc933ea2cd11a2b7fd654450bd460088516afef3e2/richenum-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "351d472ad50c0fef6bf568572a93d28a", "sha256": "2446e2de8b720de6287643d8f2342b13d76723b1954ed31b6a50d48f120b6d74" }, "downloads": -1, "filename": "richenum-1.0.3.tar.gz", "has_sig": false, "md5_digest": "351d472ad50c0fef6bf568572a93d28a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6647, "upload_time": "2013-12-04T02:08:09", "url": "https://files.pythonhosted.org/packages/eb/d4/51d770316ec4fdb55a2350b49172393b5926c1387804c007750b3eaa6da5/richenum-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "c26c780976c57bfe810afdc595e83148", "sha256": "b7a381501a540e762b96839881109593edcea5748321df8197425744d4b864d6" }, "downloads": -1, "filename": "richenum-1.0.4.tar.gz", "has_sig": false, "md5_digest": "c26c780976c57bfe810afdc595e83148", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6745, "upload_time": "2013-12-16T22:55:43", "url": "https://files.pythonhosted.org/packages/35/55/0c0c8a212f777408735e13b36594be9aa69912d4c471670db7ad414e6443/richenum-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "81b32c9f5fbdf5835841ed6973f3a0e9", "sha256": "7ef4bdb8f73cde409746285ae18e8bbb8fd6af7f099c9ed4061ab89456f57bef" }, "downloads": -1, "filename": "richenum-1.0.5.tar.gz", "has_sig": false, "md5_digest": "81b32c9f5fbdf5835841ed6973f3a0e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6767, "upload_time": "2014-05-02T19:16:53", "url": "https://files.pythonhosted.org/packages/da/10/622d844b2053174e3fa882334047b32d2c05362db1d2601159dd03b4f033/richenum-1.0.5.tar.gz" } ], "1.1.0": [], "1.1.1": [ { "comment_text": "", "digests": { "md5": "5a2df7905346bdecee77f57c82d2786d", "sha256": "ce03881bcb5a7ac061e42096c9cd78aff6edf7f0b556d5cb34d3fabe40fdda92" }, "downloads": -1, "filename": "richenum-1.1.1.tar.gz", "has_sig": false, "md5_digest": "5a2df7905346bdecee77f57c82d2786d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7489, "upload_time": "2016-02-11T18:55:27", "url": "https://files.pythonhosted.org/packages/e5/06/c4397b4ead6b331f0f82dd0ce5ba844e439387ec69f2525f9ebea01236e9/richenum-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "843d9a5d4c378691441fb9a2710450c2", "sha256": "7eff6770e1a101f0ff7b925c1bb3f713667a7ec753b18e2a1d3ef600628b6da3" }, "downloads": -1, "filename": "richenum-1.1.2.tar.gz", "has_sig": false, "md5_digest": "843d9a5d4c378691441fb9a2710450c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7535, "upload_time": "2016-02-15T04:36:05", "url": "https://files.pythonhosted.org/packages/57/7c/234c396603c88c544b20c34bbc829e7386a82470c7ec8cd932ecb3a51bbc/richenum-1.1.2.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "e9bf3adfbe73ae856e18685c224501aa", "sha256": "ccc87872428a5ca478d2a170132933d9d340d11c0f7c58256113f319b56894fc" }, "downloads": -1, "filename": "richenum-1.2.0.tar.gz", "has_sig": false, "md5_digest": "e9bf3adfbe73ae856e18685c224501aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7708, "upload_time": "2016-05-24T21:22:13", "url": "https://files.pythonhosted.org/packages/aa/a5/2a491ba1df660a61d92ca333fdd6219d570d43148bbb49f28dd53afd062a/richenum-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "3844c4c5d20bb9a0eb82a14287cdbdc9", "sha256": "df0540044dca4c94cdf8c940470844b1d42bdba95898f6b8e973e9e060ed1b68" }, "downloads": -1, "filename": "richenum-1.2.1.tar.gz", "has_sig": false, "md5_digest": "3844c4c5d20bb9a0eb82a14287cdbdc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7817, "upload_time": "2016-12-05T19:37:25", "url": "https://files.pythonhosted.org/packages/51/6f/bde74324820aa14f8e1e6939500ab55fd7426d53465396d5a0b4cd7a571e/richenum-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3844c4c5d20bb9a0eb82a14287cdbdc9", "sha256": "df0540044dca4c94cdf8c940470844b1d42bdba95898f6b8e973e9e060ed1b68" }, "downloads": -1, "filename": "richenum-1.2.1.tar.gz", "has_sig": false, "md5_digest": "3844c4c5d20bb9a0eb82a14287cdbdc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7817, "upload_time": "2016-12-05T19:37:25", "url": "https://files.pythonhosted.org/packages/51/6f/bde74324820aa14f8e1e6939500ab55fd7426d53465396d5a0b4cd7a571e/richenum-1.2.1.tar.gz" } ] }