This page describes PyMOL's plugin architechture since version 1.5.0.6.
API Entry Points
A plugin is a Python module which uses PyMOL's API. The following entrypoints add functionality to PyMOL:
pymol.cmd.extend(func) registers a function as a PyMOL command
pymol.plugins.addmenuitemqt(label, callback) adds a plugin menu item, should be called inside __init_plugin__
MyPlugin.__init_plugin__(app) is called during plugin initialization (if defined by the plugin)
__init_plugin__
A plugin can implement an __init_plugin__(app) function (previously __init__, deprecated) which is called during plugin initialization. It is passed an object which is compatible with the legacy PMGApp instance and provides access to the Tkinter parent (app.root).
Example for a PyQt5 GUI (PyMOL 2.x)
See also the Plugins Tutorial
<syntaxhighlight lang="python">
de ..→