naturtag.cli module#

class naturtag.cli.TaxonParam#

Bases: click.types.ParamType

Custom parameter with taxon name autocompletion

name: str = 'taxon'#

the descriptive name of this type

shell_complete(ctx, param, incomplete)#

Return a list of CompletionItem objects for the incomplete value. Most types do not provide completions, but some do, and this allows custom types to provide custom completions as well.

Parameters
  • ctx – Invocation context for this command.

  • param – The parameter that is requesting completion.

  • incomplete – Value being completed. May be empty.

New in version 8.0.

naturtag.cli.colorize_help_text(text)#

Colorize code blocks and headers in CLI help text

naturtag.cli.format_taxa(results, verbose=False)#

Format taxon autocomplete results into a table

Return type

Table

naturtag.cli.install_shell_completion(shell)#

Copy packaged completion scripts for the specified shell(s)

naturtag.cli.print_all_metadata(image_paths, flickr_format=False, hierarchical=False)#

Print keyword metadata for all specified files

naturtag.cli.print_metadata(keyword_meta, flickr_format=False, hierarchical=False)#

Print keyword metadata for a single observation/taxa

naturtag.cli.search_taxa_by_name(taxon, verbose=False)#

Search for a taxon by name. If there’s a single unambiguous result, return its ID; otherwise prompt with choices.

Return type

Optional[int]