🔌 Application Programming Interface#

main apps core module.

error(text, **kwargs)#

Display an error message.

Parameters:
  • text (str) – Text to display

  • **kwargs (Any) – Additional parameters passed to click.secho

Return type:

None

info(text, **kwargs)#

Display an info message.

Parameters:
  • text (str) – Text to display

  • **kwargs (Any) – Additional parameters passed to click.secho

Return type:

None

warning(text, **kwargs)#

Display a warning.

Parameters:
  • text (str) – Text to display

  • **kwargs (Any) – Additional parameters passed to click.secho

Return type:

None

comment(text, **kwargs)#

Display a comment.

Parameters:
  • text (str) – Text to display

  • **kwargs (Any) – Additional parameters passed to click.secho

Return type:

None

prompt(text, **kwargs)#

Prompt the user.

Parameters:
  • text (str) – Text to display

  • **kwargs (Any) – Additional parameters passed to click.prompt

Return type:

Any

confirm(text, **kwargs)#

Prompt the user for a confirmation.

Parameters:
  • text (str) – Text to display

  • **kwargs (Any) – Additional parameters passed to click.confirm

Return type:

bool

class AppStyles#

Bases: object

Styles used in aplication.

ERROR#

Style for errors ({"fg": "red", "bold": True} by default).

WARNING#

Style for warnings ({"fg": "yellow", "bold": True} by default).

INFO#

Style for informations ({"fg": "bright_magenta"} by default).

COMMENT#

Style for comments ({"fg": "green"} by default).

QUESTION#

Style for questions ({"fg": "cyan"} by default).

class Group(name=None, commands=None, **attrs)#

Bases: Group

Group class for the GALACTIC app.

It does two things:

  • it detects plugins from the galactic.apps.cli.main group.

  • it adds an epilog to all added commands.

add_command(cmd, name=None)#

Registers another Command with this group. If the name is not provided, the name of the command is used.

Return type:

None

classmethod detect_plugins()#

Detect plugins from the galactic.apps.cli.main group.

Return type:

None

get_command(ctx, cmd_name)#

Given a context and a command name, this returns a Command object if it exists or returns None.

Return type:

Command | None

list_commands(ctx)#

Returns a list of subcommand names in the order they should appear.

Return type:

list[str]