grapa.shared.string_manipulations

@author: Romain Carron Copyright (c) 2026, Empa, Laboratory for Thin Films and Photovoltaics, Romain Carron

Functions

format_string_curveattr(curve, formatter)

Format a string according to formatting using python string Template, with curve attributes as variables.

listToString(val)

Converts a list to a string with suitable formatting

restructuredtext_to_text(string[, nparammax])

Converts a rest restructured text (e.g. docstring) into text, to be e.g. printed into the grapa console.

strToVar(val)

Converts a string into variable, based on ast.literal_eval, but trying otherwise if fails

strUnescapeIter(var)

Tries its best to unescape special characters.

stringToVariable(val)

Deprecated.

varToStr(val)

Converts a variable into str, ready to be displayed by the GUI

Classes

TemplateCustom(template)

Custom string Template to be able to specify key together with formatting

TextHandler()

text are draw onto plot as Annotations