High-Level API

The toplevel command line interface.

mdacli.cli.cli(name, module_list, base_class=<Mock name='mock.AnalysisBase' id='139991830367728'>, version='', description='', skip_modules=None, ignore_warnings=False)[source]

Create the command-line interface.

This function creates a command line interface with a given name based on a module list.

Parameters:
  • name (str) – name of the interface

  • module_list (list) – list of module from which the cli is build up.

  • base_class (cls) – Class or list of classes that the Anaylsis modules belong to

  • description (str) – description of the cli

  • skip_modules (list) – list of strings containing modules that should be ommited

  • ignore_warnings (bool) – ignore warnings when importing modules

Examples

This example code creates the command line interface of MDAnalysis:

from MDAnalysis.analysis import __all__

import mdacli

skip_mods = ['AnalysisFromFunction',
            'HydrogenBondAnalysis',
            'WaterBridgeAnalysis',
            'Contacts',
            'Dihedral',
            'PersistenceLength',
            'InterRDF_s']

mdacli.cli(name="MDAnalysis",
           module_list=[f'MDAnalysis.analysis.{m}' for m in __all__],
           version=mdacli.__version__,
           description=__doc__,
           skip_modules=skip_mods,
           ignore_warnings=True)