{ "info": { "author": "Yoel Cortes-Pena", "author_email": "yoelcortes@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "===============\nfree_properties\n===============\n\n.. image:: http://img.shields.io/pypi/v/free_properties.svg?style=flat\n :target: https://pypi.python.org/pypi/free_properties\n :alt: Version_status\n.. image:: http://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat\n :target: https://free_properties.readthedocs.io/en/latest/\n :alt: Documentation\n.. image:: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n :target: https://github.com/yoelcortes/free_properties/blob/master/LICENSE.txt\n :alt: license\n\n\n.. contents::\n\nWhat is free_properties?\n------------------------\n\nfree_properties is a python package that features the FreeProperty class. A FreePropety object behaves just like its value property, allowing it to be used as a proxy for get, and set calculations like a python property.\n\nInstallation\n------------\n\nGet the latest version of free_properties from\nhttps://pypi.python.org/pypi/free_properties/\n\nIf you have an installation of Python with pip, simple install it with:\n\n $ pip install free_properties\n\nTo get the git version, run:\n\n $ git clone git://github.com/yoelcortes/free_properties\n\nDocumentation\n-------------\n\nfree_properties's documentation is available on the web:\n\n http://free_properties.readthedocs.io/\n\nGetting started\n---------------\n\nThe PropertyFactory is an FreeProperty class creator that functions similar to Python 'property' objects. Use the PropertyFactory to create a Weight class which calculates weight based on density and volume:\n \n.. code-block:: python\n \n >>> def getter(self):\n ... '''Weight (kg) based on volume (m^3).'''\n ... data = self.data\n ... rho = data['rho'] # Density (kg/m^3)\n ... vol = data['vol'] # Volume (m^3)\n ... return rho * vol\n >>>\n >>> def setter(self, weight):\n ... data = self.data\n ... rho = data['rho'] # Density (kg/m^3)\n ... data['vol'] = weight / rho\n >>>\n >>> # Initialize with a value getter, setter, and the class name.\n >>> Weight = PropertyFactory(getter, setter, 'Weight')\n \nIt is more convinient to use the PropertyFactory as a decorator:\n\n.. code-block:: python\n \n >>> @PropertyFactory\n >>> def Weight(self):\n ... '''Weight (kg) based on volume (m^3).'''\n ... data = self.data\n ... rho = data['rho'] # Density (kg/m^3)\n ... vol = data['vol'] # Volume (m^3)\n ... return rho * vol\n >>>\n >>> @Weight.setter\n >>> def Weight(self, weight):\n ... data = self.data\n ... rho = data['rho'] # Density (kg/m^3)\n ... data['vol'] = weight / rho\n \n\nCreate dictionaries of data and initialize new Weight objects:\n \n.. code-block:: python\n \n >>> water_data = {'rho': 1000, 'vol': 3}\n >>> ethanol_data = {'rho': 789, 'vol': 3}\n >>> weight_water = Weight('Water', water_data)\n >>> weight_ethanol = Weight('Ethanol', ethanol_data)\n >>> weight_water\n Weight(Water) -> 3000 (kg)\n >>>weight_ethanol\n Weight(Ethanol) -> 2367 (kg)\n\nThese properties behave just like their dynamic value:\n\n.. code-block:: python\n\n >>> weight_water + 30\n 3030\n >>> weight_water + weight_ethanol\n 5367\n >>> weight_water.bit_length() # A method of the dynamic value\n 12\n \nGet and set the value through the 'value' attribute:\n \n.. code-block:: python\n\n >>> weight_water.value\n 3000\n >>> weight_water.value = 4000 \n >>> weight_water.value\n 4000\n >>> water_data # Note that the volume changed too\n {'rho': 1000, 'vol': 4}\n\nIn place magic methods will also change the property value:\n\n.. code-block:: python\n\n >>> weight_water -= 1000\n >>> weight_water\n Weight(Water) -> 3000 (kg)\n >>> water_data # The change also affects the original data\n {'rho': 1000, 'vol': 3}\n\nLatest source code\n------------------\n\nThe latest development version of free_properties's sources can be obtained at:\n\n https://github.com/yoelcortes/free_properties\n\n\nBug reports\n-----------\n\nTo report bugs, please use the free_properties' Bug Tracker at:\n\n https://github.com/yoelcortes/free_properties\n\nLicense information\n-------------------\n\nSee ``LICENSE.txt`` for information on the terms & conditions for usage\nof this software, and a DISCLAIMER OF ALL WARRANTIES.\n\nAlthough not required by the free_properties' license, if it is convenient for you,\nplease cite free_properties if used in your work. Please also consider contributing\nany changes you make back, and benefit the community.\n\n\nCitation\n--------\n\nTo cite free_properties in publications use::\n\n Yoel Cortes-Pena (2019). free_properties: Manage properties outside a class.\n https://github.com/yoelcortes/free_properties\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/yoelcortes/free_properties.git", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yoelcortes/free_properties", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "free_properties", "package_url": "https://pypi.org/project/free_properties/", "platform": "Windows", "project_url": "https://pypi.org/project/free_properties/", "project_urls": { "Download": "https://github.com/yoelcortes/free_properties.git", "Homepage": "https://github.com/yoelcortes/free_properties" }, "release_url": "https://pypi.org/project/free_properties/0.1.9/", "requires_dist": null, "requires_python": "", "summary": "Manage properties outside a class.", "version": "0.1.9" }, "last_serial": 5386244, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "23e98967972f632173d435b33b63a5d5", "sha256": "f88702dd600046a4bee8ccb61f8ca79137b6ab8defb39a9b6b645b37b94bd834" }, "downloads": -1, "filename": "free_properties-0.1.0.tar.gz", "has_sig": false, "md5_digest": "23e98967972f632173d435b33b63a5d5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5443, "upload_time": "2019-01-20T00:32:18", "url": "https://files.pythonhosted.org/packages/7c/e2/2fad4d1da106cfac3fe003d8cb6e8720e9af5762cbda7ab4d6539e835eef/free_properties-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "892902c0d7364ac33ec28b690ef01498", "sha256": "e3c68177c29b4def1f6dec5e8f2d2a4b37d4d0cd0c416c28a43415769a39bfdd" }, "downloads": -1, "filename": "free_properties-0.1.1.tar.gz", "has_sig": false, "md5_digest": "892902c0d7364ac33ec28b690ef01498", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5375, "upload_time": "2019-01-20T01:14:33", "url": "https://files.pythonhosted.org/packages/4d/51/f5a4055330dde8ea349e0ddb0c43b39718c44eac797e3346f236dbedee61/free_properties-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f28c2c85a4a6aa1876aecc997cc3a96c", "sha256": "af6da2f62450798d5070b9c2a83ecd0e0fd1a2c62bcb020a7ea1205b3b25dd17" }, "downloads": -1, "filename": "free_properties-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f28c2c85a4a6aa1876aecc997cc3a96c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5383, "upload_time": "2019-01-20T01:18:28", "url": "https://files.pythonhosted.org/packages/7a/4e/1a38a2a919d3557620c11b9c72efc57aa16a6ee34028f1dee5c2a274839d/free_properties-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "356ea99143a13e506957adb7a3c7b716", "sha256": "6d144df3f8f363d297e1730575c234f0b508e0bcf3ce749321124794058aa23a" }, "downloads": -1, "filename": "free_properties-0.1.3.tar.gz", "has_sig": false, "md5_digest": "356ea99143a13e506957adb7a3c7b716", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5383, "upload_time": "2019-01-20T01:23:48", "url": "https://files.pythonhosted.org/packages/53/02/b5bab006e6f24e54d9ffd11e4bfea0b249689bf5212e794adbd4a1c162b2/free_properties-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "2c45523b540ce50cdf46911f117df504", "sha256": "b5ae73623bbe53e42bb20965f87137e78caf781dcb0db34dd254468c6ab5a1df" }, "downloads": -1, "filename": "free_properties-0.1.4.tar.gz", "has_sig": false, "md5_digest": "2c45523b540ce50cdf46911f117df504", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5372, "upload_time": "2019-01-26T19:03:55", "url": "https://files.pythonhosted.org/packages/1a/f4/8ebaf046ba515eeecbf19da0d976c6dbf0e07d67712a80ff7a9afb8547ba/free_properties-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "633605f3ba6b661a24dcd1a900b46540", "sha256": "66c2a81beeffc9dc224a24100d182cc40edd92bb7ffac2522862c6d088603bc4" }, "downloads": -1, "filename": "free_properties-0.1.5.tar.gz", "has_sig": false, "md5_digest": "633605f3ba6b661a24dcd1a900b46540", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5361, "upload_time": "2019-04-05T00:11:32", "url": "https://files.pythonhosted.org/packages/0e/37/f4022aee3e7d5db7633f3200fb5ad590fa1633ddb2821dfdba0f40d0b0ce/free_properties-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "5370b55a3851bcb6cf0584c5bcba5a26", "sha256": "2ae81dfa1b2f24483fe2a91cb5a07a1c5fcebc481247891a38e5527d52adb435" }, "downloads": -1, "filename": "free_properties-0.1.6.tar.gz", "has_sig": false, "md5_digest": "5370b55a3851bcb6cf0584c5bcba5a26", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5360, "upload_time": "2019-04-07T17:50:40", "url": "https://files.pythonhosted.org/packages/a4/5b/78f1b9b2f982da3859014bbeffc40aba7b5117481b05fe7a40fb70738b2c/free_properties-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "b22df42d471a362899519b305c69acd3", "sha256": "18ff55f011fa7fee5b94919e2f71dcfac07bee5e03b982d53b60738ea5ff40aa" }, "downloads": -1, "filename": "free_properties-0.1.7.tar.gz", "has_sig": false, "md5_digest": "b22df42d471a362899519b305c69acd3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4756, "upload_time": "2019-04-10T17:06:04", "url": "https://files.pythonhosted.org/packages/87/4b/56ba9baf9883ce350283f78eff716fbfe932753410d0132814e3e6d0311b/free_properties-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "9f05f89ee52c7296aaafcfe7f01f087b", "sha256": "e98b7a1368b41e919a21e318a3a1f67c83b51f01aa9cc2406969683a89a1d550" }, "downloads": -1, "filename": "free_properties-0.1.8.tar.gz", "has_sig": false, "md5_digest": "9f05f89ee52c7296aaafcfe7f01f087b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4760, "upload_time": "2019-04-25T06:33:28", "url": "https://files.pythonhosted.org/packages/22/0a/7b981249dc43fc0d41f713ced7f4eb96736555bf2964c361a9c4339e4fee/free_properties-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "4a8882663337707db238716f1aa6981e", "sha256": "e34f2e165a17e5bca37617a8e6093d6cdfd87a64856f0f4f33c839dc7ecb2b9b" }, "downloads": -1, "filename": "free_properties-0.1.9.tar.gz", "has_sig": false, "md5_digest": "4a8882663337707db238716f1aa6981e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4769, "upload_time": "2019-06-11T12:01:48", "url": "https://files.pythonhosted.org/packages/82/23/8759ede32bd46a59fdbdf4afec7c2cd3aea430691a5ef82b1393f8817335/free_properties-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4a8882663337707db238716f1aa6981e", "sha256": "e34f2e165a17e5bca37617a8e6093d6cdfd87a64856f0f4f33c839dc7ecb2b9b" }, "downloads": -1, "filename": "free_properties-0.1.9.tar.gz", "has_sig": false, "md5_digest": "4a8882663337707db238716f1aa6981e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4769, "upload_time": "2019-06-11T12:01:48", "url": "https://files.pythonhosted.org/packages/82/23/8759ede32bd46a59fdbdf4afec7c2cd3aea430691a5ef82b1393f8817335/free_properties-0.1.9.tar.gz" } ] }