{ "info": { "author": "Adam Venturella", "author_email": "aventurella@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", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "# Figurine\n\n**Simple, structure only models with inheritance**\n\nFigurine is intended for dumb models. In other words, data only, no methods.\nFor web apps, view models come to mind, or anywhere you would like a model that\ndoes nothing but represent data.\n\nCurrently run on Python 2.6+, 3.x will be supported shortly.\n\n**What about namedtuples?**\n\nYes, you could just use namedtuple for this, and that might even be better.\nIf you want your model defs to look more like traditional python objects however,\nFigurine can help.\n\nIt still may be that namedtuples are a better solution, though you may \nneed a factory function to start them off with defaults of your choosing.\n\nThe base of a figuerine object is a dict, which is a bit better, for my need, for \nJSON serialization if needed, which you could also just do with namedtuple._asdict\nif you really wanted to use a namedtuple.\n\n\n### Using Figurine\n\n```python\nimport figurine\n\nclass FacebookData(figurine.Model):\n def __init__(self):\n self.posts = ['facebook']\n\nclass TwitterData(figurine.Model):\n def __init__(self):\n self.tweets = ['twitter']\n\nclass SocialData(FacebookData, TwitterData):\n pass\n\nclass SimplePage(figurine.Model):\n \n def __init__(self):\n self.title = \"\"\n self.stylesheets = []\n self.javascript = []\n self.meta = {}\n self.value = 1\n\nclass HomePage(SimplePage, SocialData):\n \n def __init__(self):\n self.username = \"lucy_the_dog\"\n\nmodel1 = HomePage()\nprint(model.tweets)\n# {'username': 'lucy_the_dog', 'title': '', 'javascript': [], 'posts': ['facebook'], 'value': 1, 'stylesheets': [], 'meta': {}, 'tweets': ['twitter']}\n\n# kwarg overrides or init\nmodel2 = HomePage(title=\"My Great Title\",\n value=2)\n\nprint(model2)\n# {'username': 'lucy_the_dog', 'title': 'My Great Title', 'javascript': [], 'posts': ['facebook'], 'value': 2, 'stylesheets': [], 'meta': {}, 'tweets': ['twitter']}\n```", "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/aventurella/figurine", "keywords": null, "license": "Copyright (c) 2012 Adam Venturella.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "figurine", "package_url": "https://pypi.org/project/figurine/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/figurine/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/aventurella/figurine" }, "release_url": "https://pypi.org/project/figurine/0.1/", "requires_dist": null, "requires_python": null, "summary": "Simple, structure only models with inheritance", "version": "0.1" }, "last_serial": 791952, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "09ef44df62489dfbbd94ecdd28987842", "sha256": "ffc3928ec9e0eb1c79ddefafac3bf3c05040834e6f1b135057a5fa1d84f4b354" }, "downloads": -1, "filename": "figurine-0.1.tar.gz", "has_sig": false, "md5_digest": "09ef44df62489dfbbd94ecdd28987842", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3572, "upload_time": "2012-09-26T03:53:38", "url": "https://files.pythonhosted.org/packages/e7/33/78d746cb2d34f1e84de76f9b70807a5a76e18290a693a33d25f07cf280b6/figurine-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09ef44df62489dfbbd94ecdd28987842", "sha256": "ffc3928ec9e0eb1c79ddefafac3bf3c05040834e6f1b135057a5fa1d84f4b354" }, "downloads": -1, "filename": "figurine-0.1.tar.gz", "has_sig": false, "md5_digest": "09ef44df62489dfbbd94ecdd28987842", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3572, "upload_time": "2012-09-26T03:53:38", "url": "https://files.pythonhosted.org/packages/e7/33/78d746cb2d34f1e84de76f9b70807a5a76e18290a693a33d25f07cf280b6/figurine-0.1.tar.gz" } ] }