aiida.plugins documentation¶
Highlevel Registry Querying¶
High level interface to read information from the cached registry, find plugins, find details about plugins.
utilities to provide information about available plugins
The plugin registry (in cache) is expected to be a dict where the keys are base entry point names of plugins (unique for registered plugins)
example registry:
registry = {
'quantumespresso': {
'name': 'aiida-quantumespresso',
'package_name': 'aiida_quantumespresso',
'pip_url': 'git+https://...',
'other_key': 'other_value'
}
'vasp': {
'name': aiida-vasp',
'package_name': 'aiida_vasp',
'...': '...'
}
}
-
aiida.plugins.info.
find_by_name
(plugin_key)[source]¶ returns the pickled RegistryEntry object for a given plugin_key
-
aiida.plugins.info.
find_by_pattern
(pattern, ranking=False)[source]¶ returns a list of RegistryEntry objects for all matches
Lowlevel Registry Interface¶
This is the low level interface for operations that have to connect to the registry online and that operate on the cache folder.
functionality to access / cache the plugin registry
-
aiida.plugins.registry.
cleanup_info
(registry=None)[source]¶ delete any plugin info files that do not correspond to a registry entry
-
aiida.plugins.registry.
load_cached
()[source]¶ load the registry from the local cache if the local cache is not readable, create or update it
-
aiida.plugins.registry.
load_online
(errorhandler=None)[source]¶ loads the registry file and returns the list of plugins
-
aiida.plugins.registry.
registry_cache_exists
()[source]¶ check if the registry cache exists
Return bool: True if exists, False if not
-
aiida.plugins.registry.
registry_cache_file_name
()[source]¶ return the name of the registry cache file
-
aiida.plugins.registry.
registry_cache_openable
()[source]¶ return true if the registry cache file can be opened
-
aiida.plugins.registry.
update
(with_info=True, registry_err_handler=None, info_err_handler=None)[source]¶ Load the registry from its online location and pickle it.
Creates the cache file if necessary. By default updates the entry details cache for each entry as well.
Parameters: - with_info – default: True, update info cache for each entry as well
- registry_err_handler – callable(exception) -> dict. Must either raise or return a registry dict
- info_err_handler – callable(exception, plugin, data) -> None. Can raise or just print an error / warning.
If none of the error handlers are given, the function will stop execution if any broken links are encountered.
Cached Info for each Plugin¶
This module and the RegistryEntry class should be the sole location for the (implicit) definition of the registry format.
-
class
aiida.plugins.entry.
RegistryEntry
(**kwargs)[source]¶ Can be created from an entry in the online aiida plugin registry. An instance will be created and cached for each entry on update.
-
cli_apps
¶ A list of cli apps installed by this plugin
-
entry_point_categories
¶ A list of categories for which this plugin exposes entry points
-
entry_points
¶ A dict of entry point names by category
-
entry_points_raw
¶ The full entry point spec in setuptools.setup() format
-
format_info
(**kwargs)[source]¶ format and return a datastructure containing all known information about the plugin
Parameters: - format – str, one of [tabulate | dict] tabulate: use tabulate to create and return a table of properties as a string dict: create a dict of properties
- as_str – bool format=’dict’ and as_str=True: return a pretty printed string version of the dict format=’dict’ and as_str=False: return a dictionary format=’tabulate’: as_str is ignored
-
gui_apps
¶ A list of GUI apps installed by this plugin
-
package_name
¶ The name used to import the package
-
test_installed
()[source]¶ Return wether the plugin is installed
First, this checks wether the package_name can be imported. If not, we know that at least no new style plugin with that name is installed.
Secondly, tests wether all the entry points are currently found by the plugin loader. If not, it is considered not installed.
- potential failures:
- loading of the entry points is not tested
- not properly uninstalled plugins might show up as
- installed if the entry points are still around.
- it does not distinguish between not installed and
- an old version is installed
-
version
¶ The version of the plugin package
-