{ "info": { "author": "Joel Widmer", "author_email": "joel@widmer.me", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.7" ], "description": "# Puradouga\n\n## Overview\n\nPuradouga is the plugin system of uradouga. Currently its only task is to act as an interface between uradouga and metadouga. But it could also interact with other projects without problems, as long as they follow the corresponding guidelines.\nPuradouga contains a generic plugin system which is defined within puradouga.core. Based on this, puradouga.plugins.media contains several classes, which serve as the base for the individual plugins. In addition, puradouga.plugins.data contains various data classes, which act as parameters for the plugins as well as results. The individual interfaces explicitly specify one of these data types or use a python data type.\n\n## Usage\n\n### Plugin\n\nPuradouga uses dynamic loading of its plugins, so it is sufficient, if the plugins are located within a certain folder. This folder is provided by uradouga.\n\nPuradouga initially searches for the implementations of its interfaces. To find them, they must be available through `import `.\nThis can be achieved by designing the plugin as a single file in which the implementations can be found. Alternatively, the plugin can be a package in which the implementations are imported into the \\_\\_init\\_\\_.py file.\n\nPlease note that puradouga must first execute the plugins normally in order to load them. It is therefore recommended not to have any code directly in the files, but all of them only accessible via the classes.\n\nThe process to create a plugin is relatively simple. First you have to find an appropriate interface. Then you write your own class based on it, which shows the desired behavior.\n\n```python\nfrom puradouga.plugins.media import TvMetaProvider\nfrom puradouga.plugins import data as pm\n\nclass HelloWorld(TvMetaProvider):\n def series_from_filename(self, filename_parsed: pm.FilenameParsed) -> pm.SeriesResponse:\n return pm.SeriesResponse(title=pm.Title(english=\"Hello World\"))\n```\n\nIn the example above a series is parsed. The method gets an object as parameter, with different information about the file. Now we create an answer and set the title to `Hello World`. If uradouga would call this plugin, the series would all have a title of `Hello World`.\n\n### Loader\n\nTo load plugins puradouga core is used mainly. The first step is to create a plugin system. This manages the individual plugins and provides methods for loading plugins. It is normally sufficient to use one PluginSystem within a project, but several can be used at the same time.\nNext, the base classes of the plugins and the folders in which the plugins are located must be registered on this system. When the system is reloaded, it is ready to use.\n\n```python\nfrom puradouga.core import PluginSystem\nfrom puradouga.plugins.media import TvMetaProvider\n\nsystem = PluginSystem(auto_reload=False)\nsystem.register_source(\"./plugins\") # Plugin folder\nsystem.register_base_class(TvMetaProvider) # Plugin base class\nsystem.reload()\n```\n\nThe next step is to create a filter. This will only return those plguins which correspond to a certain base class. All others will be ignored.\nWith the result different methods can be executed. These correspond to different strategies to execute the plugins. Depending on the method, you can sprint time because not all plugins have to be executed.\n\n```python\nfrom puradouga.core import PluginSystem\nfrom test_puradouga.test_plugin_spec import MathPlugin\n\nplugin_system = PluginSystem(auto_reload=False)\nplugin_system.register_source(\"./plugins\")\nplugin_system.register_base_class(MathPlugin)\nplugin_system.reload()\n\nmath_filter = plugin_system.get_filter(MathPlugin)\n\n# Execute all plugins and return ordered by score\nmath_filter.eval_score(MathPlugin.operation, args=[27, 13])\n\n# Execute all plugins one after another, until the code exits\nresults = list(math_filter.eval_ordered(MathPlugin.operation,\n lambda a: a,\n max_results=3,\n plugin_name_order=['Multiply', 'Divide', 'Subtract', 'Add'],\n args=[7, 5]))\n\n``` \n\nSince the eval methods all work with yield, in the second example the code can abort after each item and does not have to execute all plugins. This is not possible in the first example, because this is sorted. All plugins must have already been evaluated.\nPuradouga will filter incorrect answers as long as it is not in debug mode.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://git.widmer.me/project/multimedia/puradouga", "keywords": "plugins,anidouga", "license": "", "maintainer": "", "maintainer_email": "", "name": "puradouga", "package_url": "https://pypi.org/project/puradouga/", "platform": "", "project_url": "https://pypi.org/project/puradouga/", "project_urls": { "Homepage": "https://git.widmer.me/project/multimedia/puradouga" }, "release_url": "https://pypi.org/project/puradouga/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Uradouga Plugin System", "version": "0.3.1" }, "last_serial": 4835205, "releases": { "0.0.5": [ { "comment_text": "", "digests": { "md5": "77e20a503715b3f944888c2ce19d9a43", "sha256": "40a57f613b0bd69c440598ae9729d3c5d0b3b59e0f71b0d4bc70c4abac5503cc" }, "downloads": -1, "filename": "puradouga-0.0.5.tar.gz", "has_sig": false, "md5_digest": "77e20a503715b3f944888c2ce19d9a43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3606, "upload_time": "2018-12-13T15:02:28", "url": "https://files.pythonhosted.org/packages/a8/58/21ce9afd9e9d4fdc116030445ed43fd3037438506eb938af06d1d9bcfc1b/puradouga-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "7c87bc391600045f1f5357e7600dd3f3", "sha256": "0f898f6a6218a4ceb8e48ff2379497960236b3632ad9b63ccecf8680f848d014" }, "downloads": -1, "filename": "puradouga-0.0.6.tar.gz", "has_sig": false, "md5_digest": "7c87bc391600045f1f5357e7600dd3f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3900, "upload_time": "2018-12-18T12:36:11", "url": "https://files.pythonhosted.org/packages/e4/2a/5504e131b8d944136f1cf61e38d42974ae1f9746c76c18b5d25517e90498/puradouga-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "7118d554d722ecb8cf4cc0604eb8c68e", "sha256": "e4a023e058a9ab35b69624440a38255280fc6822a2bdeb014e1657dd634718d3" }, "downloads": -1, "filename": "puradouga-0.0.7.tar.gz", "has_sig": false, "md5_digest": "7118d554d722ecb8cf4cc0604eb8c68e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3911, "upload_time": "2018-12-18T14:07:05", "url": "https://files.pythonhosted.org/packages/36/12/f70703a6e1c94e457a69e8ea122d151dd25ba8a020530458abfa1663fb34/puradouga-0.0.7.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "3ea6b80d130877918da2ec71dbcafa1c", "sha256": "afb4f24baee20c437148ab239c123ede1a40fa0582128333308053e510266bb5" }, "downloads": -1, "filename": "puradouga-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3ea6b80d130877918da2ec71dbcafa1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3937, "upload_time": "2018-12-18T14:39:47", "url": "https://files.pythonhosted.org/packages/44/ac/ce615c0c56bccb7ecc7b8b6dc42c3ce5f1645faafe5a26e0e451f192d15f/puradouga-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "edd718dee97bffa67df38787ab45b372", "sha256": "b81f5070ff47ff6c640ca3f12fdeac13501c6f990b5f62d8eb1d40a2a31603fa" }, "downloads": -1, "filename": "puradouga-0.1.1.tar.gz", "has_sig": false, "md5_digest": "edd718dee97bffa67df38787ab45b372", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5882, "upload_time": "2018-12-18T16:08:32", "url": "https://files.pythonhosted.org/packages/72/6c/a188de594e2dfc14b097c151a4473495037520aa48f14e90d90991790995/puradouga-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "082b62fe6c32b2b73acf88937d9cc9e9", "sha256": "d9a2318f062521ba805401ad8759fdd553f18e76ea7c9838499cae0422c3dc94" }, "downloads": -1, "filename": "puradouga-0.1.2.tar.gz", "has_sig": false, "md5_digest": "082b62fe6c32b2b73acf88937d9cc9e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5982, "upload_time": "2018-12-19T10:26:30", "url": "https://files.pythonhosted.org/packages/7e/d8/caa693477a52d26a7dcad99f305fea8ef65bb112ec982b7fa9f575f14813/puradouga-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "249702f08f7eeda46bd2ad592934c421", "sha256": "ce67799869d319c3a5ff92402e8f317741c4b1d78faa52d4e55afccaf3a26e9c" }, "downloads": -1, "filename": "puradouga-0.1.3.tar.gz", "has_sig": false, "md5_digest": "249702f08f7eeda46bd2ad592934c421", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12156, "upload_time": "2019-01-10T21:13:28", "url": "https://files.pythonhosted.org/packages/a8/47/5ce6c39455ab878b1e810c0bd36496b39ffa9c3048dec7656bd31ac8422d/puradouga-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "3853a06627f2525dd5bd4a538b0cadb0", "sha256": "7603673fc614cf32ff660243072de8c0943df53ebfd0283bb9dd339bd91f24e3" }, "downloads": -1, "filename": "puradouga-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3853a06627f2525dd5bd4a538b0cadb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12206, "upload_time": "2019-01-17T18:51:53", "url": "https://files.pythonhosted.org/packages/30/4e/9435d4cace4a222514a5aeb3f5050391e20faf059beadbc7b7b345c0515a/puradouga-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "8bcdc7c945104a39abd7d26415c475d0", "sha256": "b2c60a879de4ac33278a7d730bded72e38b711f38b502d752329a1ee669760d5" }, "downloads": -1, "filename": "puradouga-0.2.1.tar.gz", "has_sig": false, "md5_digest": "8bcdc7c945104a39abd7d26415c475d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12291, "upload_time": "2019-01-19T15:42:08", "url": "https://files.pythonhosted.org/packages/a4/42/ee5998c539f0361d4aed3ab3272d06a8c5cd488b400ec010ca316900fc95/puradouga-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "723a5a3d7d9c7e2cbe314c1baa0e6c03", "sha256": "9755983a6ce1ae590d74a1b7bf4b929826793cd7e6d037b3c6ddc99ba5a07410" }, "downloads": -1, "filename": "puradouga-0.3.0.tar.gz", "has_sig": false, "md5_digest": "723a5a3d7d9c7e2cbe314c1baa0e6c03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12400, "upload_time": "2019-01-27T00:49:48", "url": "https://files.pythonhosted.org/packages/42/5f/522ec11926a41ed6fe0f628b47f5315261746a867202668971b2164cc2b4/puradouga-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "258efc39555e628072bd5215ac58c17e", "sha256": "562cb0a196d8110fd18714c128adebab4ce58b68d4c201ae383f89d9d7a7d762" }, "downloads": -1, "filename": "puradouga-0.3.1.tar.gz", "has_sig": false, "md5_digest": "258efc39555e628072bd5215ac58c17e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12414, "upload_time": "2019-02-18T13:58:43", "url": "https://files.pythonhosted.org/packages/1a/bf/8bd5436671d59a3fcbfd75cf698db36f8f3139658dcf7b0de9319b819a8c/puradouga-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "258efc39555e628072bd5215ac58c17e", "sha256": "562cb0a196d8110fd18714c128adebab4ce58b68d4c201ae383f89d9d7a7d762" }, "downloads": -1, "filename": "puradouga-0.3.1.tar.gz", "has_sig": false, "md5_digest": "258efc39555e628072bd5215ac58c17e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12414, "upload_time": "2019-02-18T13:58:43", "url": "https://files.pythonhosted.org/packages/1a/bf/8bd5436671d59a3fcbfd75cf698db36f8f3139658dcf7b0de9319b819a8c/puradouga-0.3.1.tar.gz" } ] }