{ "info": { "author": "Ofek Lev", "author_email": "ofekmeister@gmail.com", "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 :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "venum\n=====\n\n.. image:: https://img.shields.io/pypi/v/venum.svg?style=flat-square\n :target: https://pypi.org/project/venum\n\n.. image:: https://img.shields.io/travis/ofek/venum.svg?branch=master&style=flat-square\n :target: https://travis-ci.org/ofek/venum\n\n.. image:: https://img.shields.io/codecov/c/github/ofek/venum.svg?style=flat-square\n :target: https://codecov.io/gh/ofek/venum\n\n.. image:: https://img.shields.io/pypi/pyversions/venum.svg?style=flat-square\n :target: https://pypi.org/project/venum\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square\n :target: https://en.wikipedia.org/wiki/MIT_License\n\n-----\n\nvenum provides an Enum that is actually just a namedtuple, but easier to create.\nThis means an Enum doesn't have to be defined before program execution (similar\nto the functional API) and members are truly immutable (can't dynamically add\nnew ones). Also, this saves a bit of memory over the stdlib's Enum.\n\nUsage\n-----\n\n.. code-block:: python\n\n >>> from venum import Enum\n >>>\n >>> ContentTypes = Enum(\n ... ('JSON', 'application/json; charset=utf-8'),\n ... ('HTML', 'text/html; charset=utf-8'),\n ... ('JS', 'text/javascript; charset=utf-8'),\n ... ('XML', 'application/xml'),\n ... ('TEXT', 'text/plain; charset=utf-8'),\n ... ('JPEG', 'image/jpeg'),\n ... ('PNG', 'image/png'),\n ... ('YAML', 'application/x-yaml'),\n ... name='ContentTypes'\n ... )\n >>> ContentTypes\n ContentTypes(JSON='application/json; charset=UTF-8', HTML='text/html; charset=utf-8', JS='text/javascript; charset=utf-8', XML='application/xml', TEXT='text/plain; charset=utf-8', JPEG='image/jpeg', PNG='image/png', YAML='application/x-yaml')\n\nAttribute lookup\n^^^^^^^^^^^^^^^^\n\nNo need for ``.value``.\n\n.. code-block:: python\n\n >>> from venum import Enum\n >>>\n >>> sample = Enum(('BLUE', 1), ('RED', 2))\n >>> sample\n Enum(BLUE=1, RED=2)\n >>> sample.BLUE\n 1\n\nComparison by value\n^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n >>> from venum import Enum\n >>>\n >>> sample = Enum(('SPADES', 1))\n >>> sample.SPADES == 1\n True\n\nMemory-efficiency\n^^^^^^^^^^^^^^^^^\n\n*This example was run on a 64-bit machine.*\n\nNote that stdlib's Enum by itself uses 1056 bytes with each member requiring\n56 bytes, whereas namedtuple Enum uses 888 bytes with each member requiring\nonly 16 bytes.\n\n.. code-block:: python\n\n >>> from sys import getsizeof\n >>> from enum import Enum as StdEnum\n >>> from venum import Enum\n >>>\n >>> class SomeEnum(StdEnum):\n ... BLUE = 3\n >>>\n >>> getsizeof(SomeEnum.__class__)\n 1056\n >>> getsizeof(Enum(('BLUE', 3)).__class__)\n 888\n\nInstallation\n------------\n\nvenum is distributed on `PyPI`_ as a universal wheel and is available on\nLinux/macOS and Windows and supports Python 2.7/3.3+ and PyPy.\n\n.. code-block:: bash\n\n $ pip install venum\n\nFinal words\n-----------\n\nThat's really all there is to it, but if you're keen on seeing more words that\nbegin with the letter **V**, here's V's monologue from `V for Vendetta`_.\n\n \"Voil\u00c3\u00a0! In view, a humble vaudevillian veteran, cast vicariously as both\n victim and villain by the vicissitudes of Fate. This visage, no mere veneer\n of vanity, is a vestige of the vox populi, now vacant, vanished. However,\n this valorous visitation of a by-gone vexation, stands vivified and has\n vowed to vanquish these venal and virulent vermin vanguarding vice and\n vouchsafing the violently vicious and voracious violation of volition.\n\n The only verdict is vengeance; a vendetta, held as a votive, not in vain,\n for the value and veracity of such shall one day vindicate the vigilant\n and the virtuous.\n\n Verily, this vichyssoise of verbiage veers most verbose, so let me simply\n add that it's my very good honor to meet you and you may call me V.\"\n\n -- V\n\n.. _PyPI: https://pypi.org/project/venum\n.. _V for Vendetta: https://en.wikipedia.org/wiki/V_for_Vendetta_(film)\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/ofek/venum", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ofek/venum", "keywords": "enum,immutable,functional,data structures", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "venum", "package_url": "https://pypi.org/project/venum/", "platform": "", "project_url": "https://pypi.org/project/venum/", "project_urls": { "Download": "https://github.com/ofek/venum", "Homepage": "https://github.com/ofek/venum" }, "release_url": "https://pypi.org/project/venum/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Verifiably better, validated Enum", "version": "1.1.0" }, "last_serial": 2907317, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "ea2e2337300949401ee7d960e07049ee", "sha256": "c998e0724e406b977ec570cb7bb79799947060c20341bc1898cf608e0622bd09" }, "downloads": -1, "filename": "venum-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ea2e2337300949401ee7d960e07049ee", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6076, "upload_time": "2017-05-24T03:18:16", "url": "https://files.pythonhosted.org/packages/11/f1/c5a9a653231489f401d748896ed09aa10e8cbe3f37e94a8beac1dd95bd54/venum-1.0.0-py2.py3-none-any.whl" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "112a80e6c1584c4b7e98e849665d9275", "sha256": "2c4b0b096dda418489861aed20c4188f5a472f2e2037a6836fdddf4c0d98ba82" }, "downloads": -1, "filename": "venum-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "112a80e6c1584c4b7e98e849665d9275", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6673, "upload_time": "2017-05-29T18:59:43", "url": "https://files.pythonhosted.org/packages/96/44/a846eac63a4cde832e6c94d3c89d04bcee56c88e6d2168324ada957bf717/venum-1.1.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "112a80e6c1584c4b7e98e849665d9275", "sha256": "2c4b0b096dda418489861aed20c4188f5a472f2e2037a6836fdddf4c0d98ba82" }, "downloads": -1, "filename": "venum-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "112a80e6c1584c4b7e98e849665d9275", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6673, "upload_time": "2017-05-29T18:59:43", "url": "https://files.pythonhosted.org/packages/96/44/a846eac63a4cde832e6c94d3c89d04bcee56c88e6d2168324ada957bf717/venum-1.1.0-py2.py3-none-any.whl" } ] }