{"library":"npe2","title":"napari Plugin Engine v2 (npe2)","description":"npe2 (napari plugin engine v2) is the modern, robust plugin system for napari. It facilitates explicit plugin discovery and contribution management through manifest files and package entry points, aiming for better isolation, explicit dependency management, and improved testability compared to its predecessor. The current version is 0.8.2, and it follows the napari release cycle, with frequent updates during active development phases.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install npe2"],"cli":{"name":"npe2","version":"npe2 v0.8.2"}},"imports":["from npe2 import PluginManager","from npe2.manifest import Manifest","from napari.plugins.manager import napari_plugin_manager"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from npe2 import PluginManager\n\npm = PluginManager.instance() # Get the singleton PluginManager instance\n\n# Discover all plugins, including older npe1 plugins if present\npm.discover(include_npe1=True)\n\nprint(f\"Discovered {len(pm.plugins)} plugin packages.\")\n\n# Example: List contributions from a specific plugin (e.g., 'napari-svg')\n# This assumes 'napari-svg' is installed and has contributions\nif \"napari-svg\" in pm.plugins:\n    print(f\"\\nContributions from napari-svg:\")\n    for contribution_type in pm.get_plugin_contributions(\"napari-svg\"):\n        contributions = pm.get_plugin_contributions(\"napari-svg\")[contribution_type]\n        if contributions:\n            print(f\"  {contribution_type}: {list(contributions.keys())}\")\nelse:\n    print(\"\\nnapari-svg not found or has no contributions. Try another installed plugin.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the npe2 PluginManager, discover available plugins (including npe1 plugins), and then inspect the contributions provided by a specific plugin. It shows how the engine itself can be used to query the plugin ecosystem.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}