{"id":24245,"library":"plugincode","title":"plugincode","description":"plugincode is a Python library providing plugin functionality for the ScanCode toolkit. It defines a plugin system with hooks, data-driven processing, and a registry for plugins. Current version 32.0.0, released June 2023. Release cadence is irregular, with major version bumps.","status":"active","version":"32.0.0","language":"python","source_language":"en","source_url":"https://github.com/nexB/plugincode","tags":["plugins","scancode","plugin-system","hooks"],"install":[{"cmd":"pip install plugincode","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Provides Codebase and Resource classes used in plugin processing","package":"commoncode","optional":false},{"reason":"Used for version comparisons","package":"packaging","optional":false}],"imports":[{"note":"PluginManager is exposed at the top-level package, not in a submodule","wrong":"from plugincode.manager import PluginManager","symbol":"PluginManager","correct":"from plugincode import PluginManager"},{"note":"The default instance of PluginManager is also at top-level","wrong":"","symbol":"plugin_manager","correct":"from plugincode import plugin_manager"},{"note":"Registry class for plugins","wrong":"","symbol":"PluginsRegistry","correct":"from plugincode import PluginsRegistry"}],"quickstart":{"code":"from plugincode import plugin_manager\n\n# Get all registered plugins\nfor plugin in plugin_manager.get_plugins():\n    print(plugin)\n\n# Or get plugins by hook name\nfor plugin in plugin_manager.get_plugins_by_hook('pre_scan'):\n    print(plugin.name)","lang":"python","description":"Basic usage: iterate over registered plugins or filter by hook."},"warnings":[{"fix":"Upgrade to Python 3.7 or later.","message":"Python 3.6 support dropped in v31.0.0","severity":"breaking","affected_versions":">=31.0.0"},{"fix":"Use semantic versioning for dependency specs (e.g., plugincode>=30.0.0).","message":"Calver versioning dropped in v30.0.0; now uses semver.","severity":"deprecated","affected_versions":"<30.0.0"},{"fix":"Use the pre-initialized `plugin_manager` instance from `plugincode` module instead of creating a new PluginManager().","message":"PluginManager is a singleton; direct instantiation may lead to multiple instances.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install plugincode","cause":"plugincode not installed.","error":"ModuleNotFoundError: No module named 'plugincode'"},{"fix":"Upgrade to latest version: pip install --upgrade plugincode","cause":"Outdated version (<30.0.0) where PluginManager was not exposed at top level.","error":"AttributeError: module 'plugincode' has no attribute 'PluginManager'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}