{ "info": { "author": "Vladimir Keleshev", "author_email": "vladimir@keleshev.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Utilities" ], "description": "Implementation of Value Object Pattern for Python\n=================================================\n\n`From Wikipedia `_:\n\n A **value object** is a small object that represents a\n simple entity whose equality isn't based on identity: i.e.\n two value objects are equal when they have the same value,\n not necessarily being the same object.\n\nBy default (if you subclass from ``object``) Python follows\n\"reference semantics\", i.e. two objects are equal if they\nare the same instance. ``Value`` class implements \"value\nsemantics\", i.e. if you subclass it your objects will be\nequall if they hold the same data.\n\nThis implementation will also inspect your ``__init__``\nsignature to automatically assign instance variables and\nproduce a nice ``__repr__`` for your objects, dogether with\na suitable ``__hash__`` implementation.\n\nInstead of asigning each instance variable manually:\n\n.. code:: python\n\n >>> class Date(object):\n ...\n ... def __init__(self, year, month=1, day=1):\n ... self.year = year\n ... self.month = month\n ... self.day = day\n\n``Value`` defines ``__new__`` that will look at your\n``__init__`` signature and assign instance variables based\non it:\n\n.. code:: python\n\n >>> from value import Value\n ...\n >>> class Date(Value):\n ...\n ... def __init__(self, year, month=1, day=1):\n ... pass\n ...\n >>> Date(2013, 3).year == 2013\n True\n >>> Date(2013, 3).month == 3\n True\n >>> Date(2013, 3).day == 1\n True\n\n``Value`` defines ``__eq__`` and ``__ne__`` to implement\nvalue object semantics, i.e. objects holding the same data\nare compared equal:\n\n.. code:: python\n\n >>> Date(2013, 3, 18) == Date(2013, 3, 18)\n True\n >>> Date(2013, 3, 18) != Date(1988)\n True\n\n``Value`` also defines ``__repr__`` for you based on\n``__init__`` signature:\n\n.. code:: python\n\n >>> repr(Date(2013, 3, 18))\n 'Date(2013, 3, 18)'\n >>> repr(Date(1988, 1, 1))\n 'Date(1988)'\n\n``Value`` also defines ``__hash__`` for you, so that\ninstances could be used in sets and as dictionary keys.\n\nInstallation\n------------------------------------------------------------\n\nUse `pip `_ or easy_install::\n\n pip install value==0.1.0\n\nAlternatively, you can just drop ``value.py`` file into your\nproject\u2014it is self-contained.\n\n- **value** is tested with Python 2.6, 2.7, 3.2, 3.3 and PyPy.\n- **value** follows `semantic versioning `_.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/halst/value", "keywords": "value object pattern", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "value", "package_url": "https://pypi.org/project/value/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/value/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/halst/value" }, "release_url": "https://pypi.org/project/value/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Implementation of Value Object pattern", "version": "0.1.0" }, "last_serial": 652807, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2148ba70c44414eaf309080efbf0cf9a", "sha256": "9d6f696f9ac0d5ecb6189f6fe08e153cc6ee39449c3b23100e565b156a60c569" }, "downloads": -1, "filename": "value-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2148ba70c44414eaf309080efbf0cf9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3438, "upload_time": "2013-03-18T22:22:38", "url": "https://files.pythonhosted.org/packages/13/d5/33f2063de7e21cf41cd6c029d2212cea9da7062e45cad37b3942bf935f7a/value-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2148ba70c44414eaf309080efbf0cf9a", "sha256": "9d6f696f9ac0d5ecb6189f6fe08e153cc6ee39449c3b23100e565b156a60c569" }, "downloads": -1, "filename": "value-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2148ba70c44414eaf309080efbf0cf9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3438, "upload_time": "2013-03-18T22:22:38", "url": "https://files.pythonhosted.org/packages/13/d5/33f2063de7e21cf41cd6c029d2212cea9da7062e45cad37b3942bf935f7a/value-0.1.0.tar.gz" } ] }