{ "info": { "author": "Lain Supe (lainproliant)", "author_email": "lainproliant@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries" ], "description": "Xenum: A simple alternative to Python 3 Enums.\n==============================================\n\nXenum offers a simple alternative to Python 3 enums that's\nespecially useful for (de)serialization. When you would like\nto model your enum values so that they survive jumps to and\nfrom JSON, databases, and other sources cleanly as strings,\nXenum will allow you to do so extremely easily.\n\nInstallation\n------------\n\nInstallation is simple. With python3-pip, do the following:\n\n$ sudo pip install -e .\n\nOr, to install the latest version available on PyPI:\n\n$ sudo pip install xenum\n\nUsage\n-----\nJust create a basic class with attributes and annotate it with the\n``@xenum`` attribute. This will convert all of the class attributes\ninto Xenum instances and allow you to easily convert them to strings\nvia ``str(MyEnum.A)`` and from strings via ``MyEnum.by_name(\"MyEnum.A\")``.\n\nExample\n-------\n::\n\n from xenum import xenum, ctor\n\n @xenum\n class Actions:\n INSERT = ctor('insert')\n UPDATE = ctor('update')\n DELETE = ctor('delete')\n\n def __init__(self, name):\n self.name = name\n \n assert Actions.INSERT == Actions.by_name('Actions.INSERT')\n assert Actions.INSERT().name == 'insert'\n\nCheckout ``test.py`` in the git repo for more usage examples.\n\nChange Log\n----------\n\nVersion 1.4: September 5th, 2016\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n- Add 'xenum.sref()' allowing enum values to be instances of the\n @xenum annotated class, whos `*args` is prepended with the \n Xenum instance itself for self-reference.\n\nVersion 1.3: September 4th, 2016\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n- Add 'xenum.ctor()' allowing enum values to be instances of the\n @xenum annotated class.\n- Made Xenum instances callable, returning the enum's internal value.\n\nVersion 1.2: September 4th, 2016\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n- Add 'values()' method to @xenum annotated classes for fetching\n an ordered sequence of the Xenum entities created.\n\nVersion 1.1: August 31st, 2016\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n- Made Xenum instances hashable, removed value() as a function.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lainproliant/xenum", "keywords": "enum enums", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "xenum", "package_url": "https://pypi.org/project/xenum/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/xenum/", "project_urls": { "Homepage": "https://github.com/lainproliant/xenum" }, "release_url": "https://pypi.org/project/xenum/1.4/", "requires_dist": null, "requires_python": "", "summary": "A simple alternative to Python 3 enums.", "version": "1.4" }, "last_serial": 2326398, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "cb787f337a143c710d760816ce634c0b", "sha256": "b8892aa37d0d7f05ab4b2327911098b9a0deb5b98ce9860c7dba227c0fe99bda" }, "downloads": -1, "filename": "xenum-1.0.tar.gz", "has_sig": true, "md5_digest": "cb787f337a143c710d760816ce634c0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3677, "upload_time": "2016-09-01T04:57:57", "url": "https://files.pythonhosted.org/packages/e7/a5/818ee7a09d51ebb2c87c0d82bba04d17879a25c72de8652e18b276954a16/xenum-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "919cabce8df6ed8eeed5b94174197aed", "sha256": "42f3a213c5f8350a518f6878fef86d2b3bbf4f88937b95df7ca7ec761518f9b4" }, "downloads": -1, "filename": "xenum-1.1.tar.gz", "has_sig": true, "md5_digest": "919cabce8df6ed8eeed5b94174197aed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3783, "upload_time": "2016-09-01T05:14:17", "url": "https://files.pythonhosted.org/packages/a0/3c/85b5f776aff1d3a2d490af31cbfb8b366f708f8491a4f5b8136f61b5da94/xenum-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "bc31552bf1f6197cb43f850728662ca4", "sha256": "f0308a6ec4e8348a9cfc6974945fd91126837bb420bbb12bd19f92f91f4aa511" }, "downloads": -1, "filename": "xenum-1.2.tar.gz", "has_sig": true, "md5_digest": "bc31552bf1f6197cb43f850728662ca4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3888, "upload_time": "2016-09-05T02:43:01", "url": "https://files.pythonhosted.org/packages/a1/79/97f4d5fb54055f66470c17d5379b6d04dcf53301274b2929aa2aedc55c4e/xenum-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "facd3a313cbca995035e989b08283c5a", "sha256": "e643a083fbf9e01a32db723a20b8b024ad8a2c3aaa634033b5219ee90945552d" }, "downloads": -1, "filename": "xenum-1.3.tar.gz", "has_sig": true, "md5_digest": "facd3a313cbca995035e989b08283c5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4061, "upload_time": "2016-09-05T10:44:34", "url": "https://files.pythonhosted.org/packages/d6/0a/f856dbb2b148765715c3de467021d700f04f16c0f1d87e2367afc63f5c79/xenum-1.3.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "09ce99cf1d854112ee50bb8d130b6f8c", "sha256": "c0802956b74fa2d77af939faa517e8681bc18fcebadf94b8b3a1657d213288bb" }, "downloads": -1, "filename": "xenum-1.4.tar.gz", "has_sig": true, "md5_digest": "09ce99cf1d854112ee50bb8d130b6f8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4321, "upload_time": "2016-09-06T00:03:59", "url": "https://files.pythonhosted.org/packages/03/bf/ef6b523c4d63f0f84c91b6ccfe467d6d184c1c1f7afa1bad83b3ac2b5e9a/xenum-1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09ce99cf1d854112ee50bb8d130b6f8c", "sha256": "c0802956b74fa2d77af939faa517e8681bc18fcebadf94b8b3a1657d213288bb" }, "downloads": -1, "filename": "xenum-1.4.tar.gz", "has_sig": true, "md5_digest": "09ce99cf1d854112ee50bb8d130b6f8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4321, "upload_time": "2016-09-06T00:03:59", "url": "https://files.pythonhosted.org/packages/03/bf/ef6b523c4d63f0f84c91b6ccfe467d6d184c1c1f7afa1bad83b3ac2b5e9a/xenum-1.4.tar.gz" } ] }