{ "info": { "author": "Pawe\u0142 Zadro\u017cny @pawelzny", "author_email": "pawel.zny@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Natural Language :: English", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "************\nValue Object\n************\n\n:Info: DDD Value Object implementation.\n:Author: Pawe\u0142 Zadro\u017cny @pawelzny \n\n.. image:: https://circleci.com/gh/pawelzny/vo/tree/master.svg?style=shield&circle-token=bcc877f72e384d82ddd044b88de1faca2ff774bc\n :target: https://circleci.com/gh/pawelzny/vo/tree/master\n :alt: CI Status\n\n.. image:: https://readthedocs.org/projects/vo/badge/?version=latest\n :target: http://vo.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://img.shields.io/pypi/v/vo.svg\n :target: https://pypi.org/project/vo/\n :alt: PyPI Repository Status\n\n.. image:: https://img.shields.io/github/release/pawelzny/vo.svg\n :target: https://github.com/pawelzny/vo\n :alt: Release Status\n\n.. image:: https://img.shields.io/pypi/status/vo.svg\n :target: https://pypi.org/project/vo/\n :alt: Project Status\n\n.. image:: https://img.shields.io/pypi/pyversions/vo.svg\n :target: https://pypi.org/project/vo/\n :alt: Supported python versions\n\n.. image:: https://img.shields.io/pypi/implementation/vo.svg\n :target: https://pypi.org/project/vo/\n :alt: Supported interpreters\n\n.. image:: https://img.shields.io/pypi/l/vo.svg\n :target: https://github.com/pawelzny/vo/blob/master/LICENSE\n :alt: License\n\nFeatures\n========\n\n* Value Objects are immutable.\n* Two objects with the same values are considered equal\n* Access to values with dot notation: ``value.my_attr``\n* Access to values by key: ``value['my_attr']``\n\n\nInstallation\n============\n\n.. code:: bash\n\n pipenv install vo # or pip install vo\n\n\n**Package**: https://pypi.org/project/vo/\n\n\nDocumentation\n=============\n\n* Full documentation: http://vo.readthedocs.io\n* Public API: http://vo.readthedocs.io/en/latest/api.html\n* Examples and usage ideas: http://vo.readthedocs.io/en/latest/examples.html\n\n\nQuick Example\n=============\n\nValue accept any ``key=value`` pairs. These pairs will be attached to object as attributes.\nOnce created values are immutable. Attributes can't be changed or deleted.\n\n.. code-block:: python\n\n >>> from vo import Value\n >>> book = Value(title='Learning Python',\n ... authors=['Mark Lutz', 'David Ascher'],\n ... publisher=\"O'REILLY\")\n >>> book\n Value(authors=['Mark Lutz', 'David Ascher'], publisher=\"O'REILLY\", title='Learning Python')\n\n >>> str(book)\n '{\"authors\": [\"Mark Lutz\", \"David Ascher\"], \"publisher\": \"O\\'REILLY\", \"title\": \"Learning Python\"}'\n\n\n.. warning:: Any attempt of value modification or delete will raise ``ImmutableInstanceError``\n\n.. code-block:: python\n\n >>> from vo import Value\n >>> book = Value(title='Learning Python',\n ... authors=['Mark Lutz', 'David Ascher'],\n ... publisher=\"O'REILLY\")\n >>> book.title = 'Spam'\n Traceback (most recent call last):\n File \"\", line 1, in \n raise ImmutableInstanceError()\n vo.value.ImmutableInstanceError: Modification of Value frozen instance is forbidden.\n\n\nValues access\n-------------\n\nValues can be accessed like object attributes or like dict keys.\n\n.. code-block:: python\n\n >>> from vo import Value\n >>> book = Value(title='Learning Python',\n ... authors=['Mark Lutz', 'David Ascher'],\n ... publisher=\"O'REILLY\")\n >>> book.title == book['title']\n True\n\n >>> book.authors == book['authors']\n True\n\n\nObjects comparison\n------------------\n\nLet's take the same book example.\n\n.. code-block:: python\n\n >>> from vo import Value\n >>> book1 = Value(title='Learning Python',\n ... authors=['Mark Lutz', 'David Ascher'],\n ... publisher=\"O'REILLY\")\n >>> book2 = Value(title='Learning Python',\n ... authors=['Mark Lutz', 'David Ascher'],\n ... publisher=\"O'REILLY\")\n >>> book1 == book2\n True\n\n >>> book1 is book2\n False\n\n\nValue lookup\n------------\n\nCheck if value exists.\n\n.. code-block:: python\n\n >>> from vo import Value\n >>> book = Value(title='Learning Python',\n ... authors=['Mark Lutz', 'David Ascher'],\n ... publisher=\"O'REILLY\")\n >>> 'title' in book\n True\n\n >>> 'price' in book\n False\n\n >>> book.title\n 'Learning Python'\n\n >>> book.price\n Traceback (most recent call last):\n File \"\", line 1, in \n AttributeError: 'Value' object has no attribute 'price'", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pawelzny/vo", "keywords": "value data object DDD", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "vo", "package_url": "https://pypi.org/project/vo/", "platform": "", "project_url": "https://pypi.org/project/vo/", "project_urls": { "Homepage": "https://github.com/pawelzny/vo" }, "release_url": "https://pypi.org/project/vo/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "DDD Value Objects implementation", "version": "1.0.0" }, "last_serial": 3809230, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fd2b07967ab0fc3e3b18db598bcef5dc", "sha256": "8df7bd40626ac90568b5a7faa0729774bdbedb2c3204fe936fd1a299bad29497" }, "downloads": -1, "filename": "vo-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "fd2b07967ab0fc3e3b18db598bcef5dc", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 4544, "upload_time": "2017-03-12T16:41:15", "url": "https://files.pythonhosted.org/packages/f8/74/06f960ff1d02562d507eae4cecb160d04dd86508ff5fc211163ca7b13b38/vo-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8f699092758bb9780b6634ceaa18f1e4", "sha256": "41c0aacb021c010493ef57904111f2d1c795b4223939fa50f4926dee57fd1c6f" }, "downloads": -1, "filename": "vo-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8f699092758bb9780b6634ceaa18f1e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2494, "upload_time": "2017-03-12T16:05:08", "url": "https://files.pythonhosted.org/packages/df/2b/45af2320af1fffa8ce45be959dff58758d3d5c42c6e422844abf477e38c7/vo-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5cdbef551afc5e9a0cf7ff769ffb40bd", "sha256": "c802ee0d3198ab832554a421c940a8036c43dc4a8965a355bfe01850a33268ef" }, "downloads": -1, "filename": "vo-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5cdbef551afc5e9a0cf7ff769ffb40bd", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5018, "upload_time": "2018-03-14T15:01:13", "url": "https://files.pythonhosted.org/packages/e7/24/12756b1631beacb057286e2a502718e75dc4d56d8eb0f099f5593220f1ae/vo-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b3320aa9e4e896023b58f64708e6d0a", "sha256": "f3c63cfcc78a96a88674a54a9b1ec67445e72f86c9ab87de201749e682712c85" }, "downloads": -1, "filename": "vo-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6b3320aa9e4e896023b58f64708e6d0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16266, "upload_time": "2018-03-14T15:01:05", "url": "https://files.pythonhosted.org/packages/1a/11/adf21b6f61f02882e8b8d71020fefdd7197d04fc7f64065cb1c0d0c18970/vo-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "8980b74b5ca1bf32ff15242bef87ca0b", "sha256": "e02de18012fda1fcf7864725f5a300cbb324fd5bbf909f5458e5a35ec4f5c13c" }, "downloads": -1, "filename": "vo-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8980b74b5ca1bf32ff15242bef87ca0b", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4910, "upload_time": "2018-03-17T14:42:30", "url": "https://files.pythonhosted.org/packages/cc/80/90a71e36cbd69e59b00a315bf837d45c4819937f388377329cad761a685d/vo-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "559d92aeed45084d7e0d2c9d76acaa54", "sha256": "7149529fea542df1e3f95b5282039845af920df0f7bb7f19853be3259af26694" }, "downloads": -1, "filename": "vo-0.3.0.tar.gz", "has_sig": false, "md5_digest": "559d92aeed45084d7e0d2c9d76acaa54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24040, "upload_time": "2018-03-17T14:42:24", "url": "https://files.pythonhosted.org/packages/d9/0c/7cb6d585955964ecdc61033e64e4b80a2753a28db3b3c8e19202066a059f/vo-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "21e1de68875c2cb5857ee9db678dad41", "sha256": "743c0e99d6d03c634316ac5d12e7a37693846a0b6c06f58bf72aaf77b1ac2ca4" }, "downloads": -1, "filename": "vo-0.3.1.tar.gz", "has_sig": true, "md5_digest": "21e1de68875c2cb5857ee9db678dad41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25194, "upload_time": "2018-03-19T10:56:27", "url": "https://files.pythonhosted.org/packages/7e/b9/018a8ce2fd162b5c5b8cf7e22e0e2983407cd40ae8da732f8942f6aeb588/vo-0.3.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "c8a26ce537e9a08fa38e70ba32a29717", "sha256": "41de934bf99f1517b5b583ca16500cdb899d6c7d0216eb0897a8e3e6dd217708" }, "downloads": -1, "filename": "vo-1.0.0.tar.gz", "has_sig": true, "md5_digest": "c8a26ce537e9a08fa38e70ba32a29717", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32446, "upload_time": "2018-04-26T05:53:20", "url": "https://files.pythonhosted.org/packages/5d/94/b2afbc4192c6a16568d4a3094531628baab9a3818485340f066213de924b/vo-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8a26ce537e9a08fa38e70ba32a29717", "sha256": "41de934bf99f1517b5b583ca16500cdb899d6c7d0216eb0897a8e3e6dd217708" }, "downloads": -1, "filename": "vo-1.0.0.tar.gz", "has_sig": true, "md5_digest": "c8a26ce537e9a08fa38e70ba32a29717", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32446, "upload_time": "2018-04-26T05:53:20", "url": "https://files.pythonhosted.org/packages/5d/94/b2afbc4192c6a16568d4a3094531628baab9a3818485340f066213de924b/vo-1.0.0.tar.gz" } ] }