Expand description

Utility functions used across goat-cli.

Functions

Shamelessly poached from the Nushell core code. Suggest the closest match to a string.

If multiple taxa are queried at once, headers will return for every new taxon. We can suppress this by storing the whole return as a string.

Determine from the CLI matches how many URLs are needing to be generated, and return a vector of random character strings to use as unique identifiers.

Creates a vector of taxon ranks which will eventually form the headers of the taxon ranks in the returned TSV file.

Compute the Levenshtein distance between two strings. Borrowed from here.

Read NCBI taxon ID’s or binomial names of species, or higher order taxa from a file.

Parse a comma separated string and return each of the elements stripped of whitespace in a vector.

Thanks to this post on stack overflow. For error messages above cli query limit, print the usize prettily.

Thanks to this post on stack overflow. Make a string uppercase on the first character.

A function to replace certain combinations of characters as their URL encoded variations. Not entirely sure if this is necessary.