Skip to content

Command Line Interface (CLI)

Mostafa Jahanifar edited this page Feb 17, 2021 · 1 revision

We are using click to create a command line interface for the TIA Toolbox.

 

The entry point for the package is defined in setup.py under entry_points:

 

setup(
    author="TIA Lab",
    author_email='[email protected]',
    ...
    description="Computational pathology toolbox developed by TIA Lab.",
    entry_points={
        'console_scripts': [
            'tiatoolbox=tiatoolbox.cli:main',
        ],
    },
    ...
)
...

This means that when installed via pip (or setuptools) then the tiatoolbox command is available to the user and will call the main function in the tiatoolbox.cli module.

 

Additionally, in __main__.py under the root of the package source a call is made to the cli.main function. The __main__.py is called then the package is run as a module e.g. python --m tiatoolbox. This simply acts as an alias, similarly to Flask and other python packages.

Clone this wiki locally