Next / Previous / Contents / Shipman's homepage

10.2. Utility functions


Abbreviates an English name according to the rules of the system. Takes a string containing a name either in the usual word order (e.g., "Aztec Thrush") or in “last, first” order (e.g., "Amakihi, Molokai").


Returns a normalized bird code: the argument is uppercased and right-padded with spaces to the maximum code length.


Splits an inverted name and returns returns a tuple (G, S).

  • If eng contains no comma, G will be equal to eng and S will be an empty string.

  • If eng contains a comma, G will be the part after the first comma (less any leading or trailing whitespace), and S will be everything up to (but not including) the first comma.


Given an English name in the customary order, such as “American Robin”, returns it in the inverted form, e.g., “Robin, American”.


Given an English name in the inverted form, such as “Robin, American”, returns the customary form, e.g., “American Robin”.