{ "info": { "author": "Petar Maric", "author_email": "petarmaric@uns.ac.rs", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development", "Topic :: Utilities" ], "description": "About\r\n=====\r\n\r\nA simple plugin framework inspired by the `work of Marty Alchin`_.\r\n\r\n`Continuous integration`_ is powered by `Jenkins`_.\r\n\r\n.. image:: http://ci.petarmaric.com/job/simple_plugins/badge/icon\r\n :target: http://ci.petarmaric.com/job/simple_plugins/\r\n\r\n.. _`work of Marty Alchin`: http://martyalchin.com/2008/jan/10/simple-plugin-framework/\r\n.. _`Continuous integration`: http://ci.petarmaric.com/job/simple_plugins/\r\n.. _`Jenkins`: https://jenkins-ci.org/\r\n\r\n\r\nInstallation\r\n============\r\n\r\nTo install simple_plugins run::\r\n\r\n $ pip install simple_plugins\r\n\r\n\r\nUsage examples\r\n==============\r\n\r\nQuick start::\r\n\r\n >>> from simple_plugins import PluginMount\r\n\r\n >>> class BaseHttpResponse(object):\r\n ... \"\"\"Mount point is not registered as a plugin\"\"\"\r\n ...\r\n ... status_code = None\r\n ...\r\n ... __metaclass__ = PluginMount\r\n ...\r\n ... class Meta:\r\n ... id_field = 'status_code'\r\n ...\r\n ... def __repr__(self):\r\n ... return \"<%s: %s>\" % (self.__class__.__name__, self.status_code)\r\n ...\r\n\r\n >>> class OK(BaseHttpResponse):\r\n ... status_code = 200\r\n ...\r\n\r\n >>> class BaseRedirection(BaseHttpResponse):\r\n ... \"\"\"'Base*' classes are not registered as plugins\"\"\"\r\n ... pass\r\n ...\r\n\r\n >>> class MovedPermanently(BaseRedirection):\r\n ... status_code = 301\r\n ...\r\n\r\n >>> class NotModified(BaseRedirection):\r\n ... status_code = 304\r\n ...\r\n\r\n >>> class BadRequest(BaseHttpResponse):\r\n ... status_code = 400\r\n ...\r\n\r\n >>> class NotFound(BaseHttpResponse):\r\n ... status_code = 404\r\n ...\r\n\r\n # All plugin info\r\n >>> BaseHttpResponse.plugins.keys()\r\n ['valid_ids', 'instances_sorted_by_id', 'id_to_class', 'instances',\r\n 'classes', 'class_to_id', 'id_to_instance']\r\n\r\n # Plugin info can be accessed using either dict...\r\n >>> BaseHttpResponse.plugins['valid_ids']\r\n set([304, 400, 404, 200, 301])\r\n\r\n # ... or object notation\r\n >>> BaseHttpResponse.plugins.valid_ids\r\n set([304, 400, 404, 200, 301])\r\n\r\n >>> BaseHttpResponse.plugins.classes\r\n set([, ,\r\n , ,\r\n ])\r\n\r\n >>> BaseHttpResponse.plugins.id_to_class[200]\r\n \r\n\r\n >>> BaseHttpResponse.plugins.id_to_instance[200]\r\n \r\n\r\n >>> BaseHttpResponse.plugins.instances_sorted_by_id\r\n [, , , , ]\r\n\r\n # Unregister the `NotFound` plugin\r\n >>> NotFound._unregister_plugin()\r\n >>> BaseHttpResponse.plugins.instances_sorted_by_id\r\n [, , , ]\r\n\r\n # Coerce the passed value into the right instance\r\n >>> BaseHttpResponse.coerce(200)\r\n \r\n\r\nPlease see `the tests`_ and `beam_integrals`_ source code for more examples.\r\n\r\n.. _`the tests`: https://github.com/petarmaric/simple_plugins/blob/master/tests.py\r\n.. _`beam_integrals`: https://github.com/petarmaric/beam_integrals\r\n\r\n\r\nContribute\r\n==========\r\n\r\nIf you find any bugs, or wish to propose new features `please let me know`_.\r\n\r\nIf you'd like to contribute, simply fork `the repository`_, commit your changes\r\nand send a pull request. Make sure you add yourself to `AUTHORS`_.\r\n\r\n.. _`please let me know`: https://github.com/petarmaric/simple_plugins/issues/new\r\n.. _`the repository`: https://github.com/petarmaric/simple_plugins\r\n.. _`AUTHORS`: https://github.com/petarmaric/simple_plugins/blob/master/AUTHORS\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/petarmaric/simple_plugins", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "simple_plugins", "package_url": "https://pypi.org/project/simple_plugins/", "platform": "any", "project_url": "https://pypi.org/project/simple_plugins/", "project_urls": { "Homepage": "https://github.com/petarmaric/simple_plugins" }, "release_url": "https://pypi.org/project/simple_plugins/1.0.3/", "requires_dist": null, "requires_python": "", "summary": "A simple plugin framework", "version": "1.0.3" }, "last_serial": 5741262, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c0fe2cd986bae2b3650b4c2c927bfbef", "sha256": "486702a9c4a2d97bc2a38aee06892d24e0be06a3d7491e17e198a0e829c21228" }, "downloads": -1, "filename": "simple_plugins-1.0.0.zip", "has_sig": false, "md5_digest": "c0fe2cd986bae2b3650b4c2c927bfbef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16288, "upload_time": "2013-08-20T09:10:28", "url": "https://files.pythonhosted.org/packages/76/d2/6d3a98f4694278d2dab6d5e5c2b9d37934a6a079cb4095c3d1e8078818b8/simple_plugins-1.0.0.zip" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "0fdc317917c3919711b0554a5702bed7", "sha256": "9470c1ec933acbc013f9507994875e24ec79d7ce2f7bcf76b2883446b6dd93ae" }, "downloads": -1, "filename": "simple_plugins-1.0.1.zip", "has_sig": false, "md5_digest": "0fdc317917c3919711b0554a5702bed7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16372, "upload_time": "2013-09-30T11:03:32", "url": "https://files.pythonhosted.org/packages/bf/67/3058f29c83cc1837c18058ad17b05212b1f67f56918c4a1c9419d625eb96/simple_plugins-1.0.1.zip" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "2d463dba3a8c4dcdb1a60d401b34c5c8", "sha256": "468b118716c504cbfc1730415d469555ed9e1deb0e4da41c2b399e10f05f2c41" }, "downloads": -1, "filename": "simple_plugins-1.0.2.tar.gz", "has_sig": false, "md5_digest": "2d463dba3a8c4dcdb1a60d401b34c5c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6810, "upload_time": "2017-11-12T21:37:16", "url": "https://files.pythonhosted.org/packages/1a/54/ac3527a6216bc24e2ac182871a0f52caa5c11c95175260c2fac3181d7f94/simple_plugins-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "a2072711d6bab5bec34bad66c14b0e99", "sha256": "d024360881c7487702dacec5bc31ef7bf0e3a71c3d156dcd1067aa586676d2fd" }, "downloads": -1, "filename": "simple_plugins-1.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "a2072711d6bab5bec34bad66c14b0e99", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5263, "upload_time": "2019-08-28T08:10:29", "url": "https://files.pythonhosted.org/packages/60/d7/9242be3c284c5ed87deb31ba9a9c4ca6597e78e855f694227600e97688a6/simple_plugins-1.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "370fac350ca668993e6f335972df0930", "sha256": "16c86f86fafbf14af3a19b967ec4fb4f10f93bfcc1b69ba8fada2bc6908b10e2" }, "downloads": -1, "filename": "simple_plugins-1.0.3.tar.gz", "has_sig": false, "md5_digest": "370fac350ca668993e6f335972df0930", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6816, "upload_time": "2019-08-28T08:10:27", "url": "https://files.pythonhosted.org/packages/fb/7a/45c44084e1c2c4c480e3db570f0cab8f90f8328d59cec05174b13a6545a3/simple_plugins-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a2072711d6bab5bec34bad66c14b0e99", "sha256": "d024360881c7487702dacec5bc31ef7bf0e3a71c3d156dcd1067aa586676d2fd" }, "downloads": -1, "filename": "simple_plugins-1.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "a2072711d6bab5bec34bad66c14b0e99", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5263, "upload_time": "2019-08-28T08:10:29", "url": "https://files.pythonhosted.org/packages/60/d7/9242be3c284c5ed87deb31ba9a9c4ca6597e78e855f694227600e97688a6/simple_plugins-1.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "370fac350ca668993e6f335972df0930", "sha256": "16c86f86fafbf14af3a19b967ec4fb4f10f93bfcc1b69ba8fada2bc6908b10e2" }, "downloads": -1, "filename": "simple_plugins-1.0.3.tar.gz", "has_sig": false, "md5_digest": "370fac350ca668993e6f335972df0930", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6816, "upload_time": "2019-08-28T08:10:27", "url": "https://files.pythonhosted.org/packages/fb/7a/45c44084e1c2c4c480e3db570f0cab8f90f8328d59cec05174b13a6545a3/simple_plugins-1.0.3.tar.gz" } ] }