ersilia.cli package

Subpackages

Submodules

ersilia.cli.cmd module

class ersilia.cli.cmd.Command[source]

Bases: object

Command class to dynamically import and execute CLI commands.

auth()[source]

Authenticate the user.

catalog()[source]

Display the catalog.

close()[source]

Close the application.

delete()[source]

Delete the application.

example()[source]

Show an example.

fetch()[source]

Fetch data.

info()[source]

Display information.

publish()[source]

Publish data.

restart()[source]

Restart the command.

run()[source]

Execute the command.

serve()[source]

Serve the application.

setup()[source]

Set up the application.

stop()[source]

Stop the command.

test()[source]

Test the application.

uninstall()[source]

Uninstall the application.

ersilia.cli.create_cli module

ersilia.cli.create_cli.create_ersilia_cli()[source]

Creates and configures the Ersilia CLI.

This function initializes the Command class, checks if the user is a contributor, and dynamically imports and executes various CLI commands based on the user’s role.

Returns:

ersilia_cli – The configured Ersilia CLI module.

Return type:

module

ersilia.cli.echo module

class ersilia.cli.echo.Silencer[source]

Bases: object

A class to manage the silencing of CLI output.

silence_file

Path to the silence file.

Type:

str

is_silence()[source]

Checks if the CLI output is silenced.

speak()[source]

Enables CLI output.

silence()[source]

Disables CLI output.

is_silence()[source]

Checks if the CLI output is silenced.

Returns:

True if the CLI output is silenced, False otherwise.

Return type:

bool

silence()[source]

Disables CLI output.

speak()[source]

Enables CLI output.

ersilia.cli.echo.echo(text, **styles)[source]

Prints styled text to the CLI, optionally with emojis, unless silenced.

Parameters:
  • text (str) – The text to be printed.

  • **styles (dict) – Additional styling options for the text.

Return type:

None

ersilia.cli.messages module

class ersilia.cli.messages.ModelNotFound(model)[source]

Bases: object

A class to handle the scenario when a model is not found.

model

The model object that was not found.

Type:

object

echo()[source]

Prints an error message and exits the program.

echo()[source]

Prints an error message indicating the model was not found and exits the program.

class ersilia.cli.messages.ModelNotInLocal(model_id)[source]

Bases: object

A class to handle the scenario when a model is not found locally.

model_id

The identifier of the model that was not found locally.

Type:

str

echo()[source]

Prints an error message and exits the program.

echo()[source]

Prints an error message indicating the model was not found locally and exits the program.

Module contents

ersilia.cli.echo(text, **styles)[source]

Prints styled text to the CLI, optionally with emojis, unless silenced.

Parameters:
  • text (str) – The text to be printed.

  • **styles (dict) – Additional styling options for the text.

Return type:

None