Welcome to harvdev-utils’s documentation!

Please refer to the sections below for information regarding common Python functions used by FlyBase developers at Harvard.

Modules for converting special characters

harvdev_utils.sgml_to_plain_text(input_string)[source]

A function to convert FlyBase SGML to plain text Greek words. e.g. &agr; -> alpha

Parameters:input_string (str) – The string containing characters to be converted.
Returns:The same string as the input with the SGML characters converted.
Return type:str
Raises:KeyError – If the regex matches for a set of SGML characters but there is no exact matching SGML.
harvdev_utils.sgml_to_unicode(input_string)[source]

A function to convert FlyBase SGML to Greek characters in unicode. e.g. &agr; -> u03B1

Parameters:input_string (str) – The string containing characters to be converted.
Returns:The same string as the input with the SGML characters converted.
Return type:str
Raises:KeyError – If the regex matches for a set of SGML characters but there is no exact matching SGML.
harvdev_utils.unicode_to_plain_text(input_string)[source]

A function to convert Greek unicode to plain text Greek words. e.g. u03B1 -> alpha

Parameters:input_string (str) – The string containing Greek unicode characters to be converted.
Returns:The same string as the input with the Greek unicode characters converted.
Return type:str
Raises:KeyError – If the regex matches for a set of unicode characters but there is no exact matching plain text.
harvdev_utils.sub_sup_to_sgml(input_string)[source]

A function to convert bracket characters to up and down flags. e.g. [hello] -> <up>hello</up>

Parameters:input_string (str) – The string containing bracket characters to be converted.
Returns:The same string as the input with the bracket characters converted.
Return type:str

Indices and tables