{ "info": { "author": "Ernesto Bossi", "author_email": "bossi.ernestog@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Topic :: Utilities" ], "description": "PyMetaBuilder\n=============\n\nIntroduction\n------------\n\nSmall framework to create entities and Builders with Metaprogramming\nfeatures in Python.\n\nCreating Builders\n-----------------\n\nMetabuilder objective is to help to create Builders and instances or\nentities with validations easy and fast.\n\nIn order to create a new Builder just define a class extending from\nMetaBuilder class, and defining an stub class in any place you want. For\neg.\n\n::\n\n from PyMetaBuilder import MetaBuilder\n\n #Stub Class to create instances from\n class Kite(object):\n pass\n\n class KiteBuilder(MetaBuilder):\n pass\n\n.. note:: from version 0.2.1 onwards you can define the class model with the method model_by_name, thus you don't have to define a stub class in your code. For ex. calling model_by_name('Kite') instead of model(Kite)\n\nAfter that just initiate the superclass and start defining the\nproperties you want KiteBuilder to have, for eg.\n\n::\n\n class KiteBuilder(MetaBuilder):\n\n def __init__(self):\n MetaBuilder.MetaBuilder.__init__(self)\n self.defineKite()\n\n def define_kite(self):\n #define the model klass to get instances from\n self.model(Kite)\n self.property(\"design\",one_of=[\"Indoor\",\"Water Kite\",\"Kythoon\"])\n self.property(\"line_material\",type=str)\n self.property(\"StringLength\",type=int)\n\nYou can also define a property as a mandatory one, with the required\nmethod. In this way, when you set the builder with the respecting\nproperties and try to get a new instance, the framework will check if\nthe properties that you previously set as mandatory were set.\n\n::\n\n def define_kite(self):\n #define the model klass to get instances from\n self.model(Kite)\n self.property(\"StringLength\",type=int)\n #code defining properties....\n self.required(\"design\")\n\nCreating instances from a Builder\n---------------------------------\n\nAfter you defined a builder and its properties, just set the parameters,\nif you want at this time and if they're not mandatory and build an\ninstance.\n\n::\n\n kiteBuilder=KiteBuilder()\n kiteBuilder.design=\"Indoor\"\n kiteBuilder.StringLength=23\n\n kite=kiteBuilder.build() #get a Kite instance\n\nWhen you set a property that you previously defined, it'll validate the\nvalue passed, given the fact that you have set it with validators, and\nwill generate the appropriate exception when it fails.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bossiernesto/PyMetabuilder", "keywords": "MetaBuilder Metaprogramming", "license": "GPL v3", "maintainer": null, "maintainer_email": null, "name": "PyMetabuilder", "package_url": "https://pypi.org/project/PyMetabuilder/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/PyMetabuilder/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bossiernesto/PyMetabuilder" }, "release_url": "https://pypi.org/project/PyMetabuilder/0.2.6/", "requires_dist": null, "requires_python": null, "summary": "Small framework for creating Builders and entities", "version": "0.2.6" }, "last_serial": 1132261, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "2e09bd14708214faa7b27be2973ffb15", "sha256": "faa22ee9669e5c0e03944610a4876a7473d25386aac40709b6030589f7a86485" }, "downloads": -1, "filename": "PyMetabuilder-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2e09bd14708214faa7b27be2973ffb15", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6458, "upload_time": "2013-08-12T05:51:49", "url": "https://files.pythonhosted.org/packages/d6/55/22bd6e313a40b9e4d7ce29ca64625fb8409480e2be329242df96b60479d0/PyMetabuilder-0.2.0.tar.gz" } ], "0.2.1": [], "0.2.2": [ { "comment_text": "", "digests": { "md5": "369576cb9dc20d81c2244250fcc04e0f", "sha256": "b810457a6d646665d19459fa8d33ac7f5ea65c9fa2788468c9194c54066e7ce2" }, "downloads": -1, "filename": "PyMetabuilder-0.2.2.tar.gz", "has_sig": false, "md5_digest": "369576cb9dc20d81c2244250fcc04e0f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7377, "upload_time": "2013-10-20T20:38:59", "url": "https://files.pythonhosted.org/packages/e0/45/8ecfff7438206d2a52ee764a5d9e6a7ead91b5ee97dad72d60c5a58d20c0/PyMetabuilder-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "99075d680b39302b463a4d2c5c5a41e2", "sha256": "2352aadf9a48439e968a3de5c991c0ba0cb7999d68f465016bc9567f2313e9d4" }, "downloads": -1, "filename": "PyMetabuilder-0.2.3.tar.gz", "has_sig": false, "md5_digest": "99075d680b39302b463a4d2c5c5a41e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7397, "upload_time": "2013-10-23T02:33:35", "url": "https://files.pythonhosted.org/packages/b3/60/78f331a5501ecff9552353d07e4776d71136872c81e4cf497f7201ff8750/PyMetabuilder-0.2.3.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "687aa93bf34eae2d6d388ace057f18a1", "sha256": "c7adaab8f740cab4597ecac878d9b39300efd2840c0b3000b54c2767a80d9e09" }, "downloads": -1, "filename": "PyMetabuilder-0.2.6.tar.gz", "has_sig": false, "md5_digest": "687aa93bf34eae2d6d388ace057f18a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7527, "upload_time": "2014-06-20T20:32:48", "url": "https://files.pythonhosted.org/packages/b5/46/2fc9fe03fa8ba315672c4e1e3215b2dce7d36ac36ef9953f0ee5aedbcafd/PyMetabuilder-0.2.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "687aa93bf34eae2d6d388ace057f18a1", "sha256": "c7adaab8f740cab4597ecac878d9b39300efd2840c0b3000b54c2767a80d9e09" }, "downloads": -1, "filename": "PyMetabuilder-0.2.6.tar.gz", "has_sig": false, "md5_digest": "687aa93bf34eae2d6d388ace057f18a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7527, "upload_time": "2014-06-20T20:32:48", "url": "https://files.pythonhosted.org/packages/b5/46/2fc9fe03fa8ba315672c4e1e3215b2dce7d36ac36ef9953f0ee5aedbcafd/PyMetabuilder-0.2.6.tar.gz" } ] }