{ "info": { "author": "Nick Groenen", "author_email": "zoni@zoni.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Plugins", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Utilities" ], "description": "=========================\nOcto - A plugin framework\n=========================\n\n*Octo is a \"plugin framework\" which allows you to write your application as a\ncollection of (optionally interconnected) plugins.*\n\nOverview\n--------\n\nOcto is a \"plugin framework\" which allows you to write your application as a\ncollection of (optionally interconnected) plugins. For example, octo makes it\neasy to write a plugin which runs a basic webserver so you can have other\nplugins hooking into that in order to expose API endpoints for various \ndifferent tasks.\n\nUsing a plugin-based approach encourages modularity and makes it easy to add or \nremove functionality, or toggle parts on and off as needed. It also makes it\neasier for people to share and exchange plugins to satisfy certain needs or to\nsolve various problems.\n\nInstalling\n----------\n\nOcto may be installed from PyPi using pip or easy_install::\n\n pip install octo\n\nAlternatively, you can install the latest bleeding-edge master version from GitHub\ndirectly::\n\n pip install https://github.com/zoni/octo/archive/master.zip\n\nLastly, you could also download the code and run ``setup.py``::\n\n python setup.py install\n\nNote: If you wish to work on octo's code itself, then you will want to install the\ndevelopment dependencies as well::\n\n pip install -r requirements-development.txt\n\nRunning octo\n------------\n\nStarting octo is as simple as running ``octo.py`` with a list of directories\nto scan for plugins::\n\n python octo.py -p plugins\n\nOcto will scan the directory ``plugins`` recursively, loading any configured \nplugins that it finds. If you have your plugins spread across more than a \nsingle directory, you can give this option multiple times::\n\n python octo.py -p plugins -p more_plugins\n\nYou can stop octo by pressing Ctrl+C, or by sending a SIGINT signal from another\nprocess (for example, kill).\n\nMaking an example plugin\n------------------------\n\nOut of the box, octo won't be able to do much for you. It will try to activate\nany plugins it finds and then drops into an idle loop. To make it do anything\nuseful, you will have to start writing plugins. Luckily, writing plugins for\nocto is really easy!\n\nTo maintain tradition, lets write a simple *\"Hello World\"* plugin. All it will\ndo is print \"Hello world!\" to the console when you activate it.\n\nFor this example, we will assume you have an empty directory called ``example``\nto store the plugin files in. As we're writing a \"Hello world\" plugin, we'll\nbe putting our python code into ``example/helloworld.py``.\n\nThe application code\n====================\n\nIn order to run, our plugin should have a class which extends\n``octo.plugin.OctoPlugin``. Since the name that we give to this class\ndoes not matter, we'll simply call it ``HelloWorld``::\n\n from octo.plugin import OctoPlugin\n\n class HelloWorld(OctoPlugin):\n \"\"\"Simple hello world example plugin\"\"\"\n pass\n\nObviously, this is still lacking functionality to greet, so we'll need to\nadd a method to our class for that.\nLooking at ``octo.plugin.OctoPlugin``, you can see it already\noffers ``octo.plugin.OctoPlugin.on_activation`` and \n``octo.plugin.OctoPlugin.on_deactivation`` for us to override. These two\nmethods are called on activation and deactivation of a plugin, respectively.\n\nUsing this, we can complete our plugin as follows::\n\n from octo.plugin import OctoPlugin\n\n class HelloWorld(OctoPlugin):\n \"\"\"Simple hello world example plugin\"\"\"\n \n def on_activation(self):\n \"\"\"Say hello on plugin activation\"\"\"\n print(\"Hello world!\")\n\nIf you now try to run octo, you'll notice that nothing actually happens::\n\n $ python octo.py -p example\n INFO:root:Initializing with plugin directories: ['example']\n ^CINFO:root:Interrupt received, shutting down\n \nThis is because we haven't actually told octo there's a plugin there forit to\nload! In order to do this, we must add a plugin file that contains a bit of \nmetadata about our plugin.\n\nThe plugin file\n===============\n\nLets create ``example/helloworld.plugin``::\n\n [Core]\n Name = Hello World\n Module = helloworld\n\n [Documentation]\n Author = Your Name\n Version = 0.1\n Website = http://example.com\n Description = My first plugin\n\n [Config]\n Enable = True\n\nWhat this file does is it gives octo some metadata about your plugin, such as\nthe Python module to import for it and whether to activate it or not. Make sure\nthat ``Core.Module`` contains the name of the file you created for your plugin,\nas this is how it knows where to find your code.\n\nAlso make sure that ``Config.Enable`` is ``True``, if it's anything else, or\nmissing entirely, then octo won't enable your plugin, and that would be sad.\n\nLastly, while it's generally a good practice, you can omit the ``Documentation``\nitems and octo won't care. This is purely a bit of metadata that becomes \nespecially useful if you end up sharing your plugin with other people.\n\nWhen we run octo again, this time we should see our greeting (we'll turn all\nlogging off as well, to make the output easier to read)::\n\n $ python octo.py -p example -l none\n Hello world!\n\nSuccess! You should now know enough to get started writing your own plugins.\nHowever, you'll probably want to spend a little more time looking at the API\ndocumentation of ``octo.plugin.OctoPlugin`` first, so you know what\nother functionality you can hook into with your own plugins.\n\nContributing\n------------\n\nOcto is an opensource project, so I would love your involvement. Please feel free\nto offer suggestions or criticisms. If you wish to contribute code, I'd be more \nthan happy to integrate your changes if I feel they make a good addition. \n\nIn order to make the experience as smooth as possible, please take these\nguidelines into consideration:\n\n- Before submitting changes, make sure all tests still pass.\n- If you add any new code, include tests for it as well. If you need help\n writing tests, please do not hesitate to reach out to me for help.\n- Commit any changes you make one change at a time, with a clear commit\n message to accompany it. This will ease the review process and makes it easier\n for people to figure out what happened when looking back at the git log.\n- Split unrelated changes into seperate pull requests. This again makes\n discussion and review easier, and ensures your first change does not block your\n other changes from being accepted.\n\nLicense\n-------\n\nOcto is available under a 2-clause BSD license (the \"Simplified BSD License\")::\n\n Copyright (c) 2013, Nick Groenen\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://octo.zoni.nl", "keywords": null, "license": "License :: OSI Approved :: BSD License", "maintainer": null, "maintainer_email": null, "name": "octo", "package_url": "https://pypi.org/project/octo/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/octo/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://octo.zoni.nl" }, "release_url": "https://pypi.org/project/octo/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "A plugin framework which allows you to write your application as a collection of (optionally interconnected) plugins.", "version": "0.3.0" }, "last_serial": 768764, "releases": { "0.2.2": [ { "comment_text": "", "digests": { "md5": "8bfec4a0280411620f3227c4ce5d83df", "sha256": "53a09be87a5b8006bc0132bfbea2934a8b19260521c548cbb1fb4f7cab993983" }, "downloads": -1, "filename": "octo-0.2.2.tar.gz", "has_sig": false, "md5_digest": "8bfec4a0280411620f3227c4ce5d83df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 201227, "upload_time": "2013-06-10T18:52:28", "url": "https://files.pythonhosted.org/packages/d6/ed/caccfaf96f3528e5cb75d529ed6d632e6e133d86f507ff15f8cd0eb1567b/octo-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "8e79a2fc23ac9e1f89fd2a83389c5941", "sha256": "e01d3eb369d15114e9670d79cb65972d7dc779f368200d3ceac17444f3901764" }, "downloads": -1, "filename": "octo-0.2.3.tar.gz", "has_sig": false, "md5_digest": "8e79a2fc23ac9e1f89fd2a83389c5941", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 201219, "upload_time": "2013-06-10T19:12:55", "url": "https://files.pythonhosted.org/packages/2f/08/b582ee7efd64bef816da3191d018ef7b8afec4502dea6f9eefed9eb522a7/octo-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "1d8271be88148f3ffb7caad7051c9399", "sha256": "2c1b9d345229b998fbc0b9a345b8f1085f896d824441ff8e34a7a3eb95072a0b" }, "downloads": -1, "filename": "octo-0.2.4.tar.gz", "has_sig": false, "md5_digest": "1d8271be88148f3ffb7caad7051c9399", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16375, "upload_time": "2013-06-11T09:05:50", "url": "https://files.pythonhosted.org/packages/04/0d/2e264cbd2692a0a054cdf41e7458fbc55872143898c2560ae51c8795c538/octo-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "97d5a74bc100817c848f8d42b4c9dc6c", "sha256": "7a627d9dfb7c0711e785e52cf9ef6f4d56fe95301cd613767e732a7504897a2d" }, "downloads": -1, "filename": "octo-0.2.5.tar.gz", "has_sig": false, "md5_digest": "97d5a74bc100817c848f8d42b4c9dc6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16411, "upload_time": "2013-06-11T09:11:31", "url": "https://files.pythonhosted.org/packages/2c/12/c8817f0e9d718e6b28a3f5cb768054ea9f92f254cd0ecf4bc004cffbf081/octo-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "5dd861ddc79363486b04fcd87d443e09", "sha256": "8fcc16461f5148cd34a7ff90442674e8130aadcea505e566306f7af6e0613b91" }, "downloads": -1, "filename": "octo-0.2.6.tar.gz", "has_sig": false, "md5_digest": "5dd861ddc79363486b04fcd87d443e09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16418, "upload_time": "2013-06-11T09:18:40", "url": "https://files.pythonhosted.org/packages/30/dc/e015b53f21e27c9ab455c5be3e5d20638043d5b98c0e3312d42e384bd307/octo-0.2.6.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "82ae5d5573cf3ae12d3125f144d313d1", "sha256": "58000e266671108faa8266fb226c8f697a71bd35b746c96adaa6accf29a9c7ca" }, "downloads": -1, "filename": "octo-0.3.0.tar.gz", "has_sig": false, "md5_digest": "82ae5d5573cf3ae12d3125f144d313d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 151793, "upload_time": "2013-06-12T07:53:43", "url": "https://files.pythonhosted.org/packages/05/df/0fde9e50899645f06b6c8aabd535e2777d591296b1b38cdb54412fb31d14/octo-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "82ae5d5573cf3ae12d3125f144d313d1", "sha256": "58000e266671108faa8266fb226c8f697a71bd35b746c96adaa6accf29a9c7ca" }, "downloads": -1, "filename": "octo-0.3.0.tar.gz", "has_sig": false, "md5_digest": "82ae5d5573cf3ae12d3125f144d313d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 151793, "upload_time": "2013-06-12T07:53:43", "url": "https://files.pythonhosted.org/packages/05/df/0fde9e50899645f06b6c8aabd535e2777d591296b1b38cdb54412fb31d14/octo-0.3.0.tar.gz" } ] }