import olex def makeSpecialCifCharacter(txt): txt = txt.replace(r"\a", r"α") txt = txt.replace(r"\A", r"Α") txt = txt.replace(r"\b", r"β") txt = txt.replace(r"\B", r"Β") txt = txt.replace(r"\c", r"χ") txt = txt.replace(r"\C", r"Χ") txt = txt.replace(r"\d", r"Δ") txt = txt.replace(r"\D", r"δ") txt = txt.replace(r"\e", r"ε") txt = txt.replace(r"\E", r"Ε") txt = txt.replace(r"\f", r"φ") txt = txt.replace(r"\F", r"Φ") txt = txt.replace(r"\g", r"γ") txt = txt.replace(r"\G", r"Γ") txt = txt.replace(r"\h", r"η") txt = txt.replace(r"\H", r"Η") txt = txt.replace(r"\k", r"κ") txt = txt.replace(r"\K", r"Κ") txt = txt.replace(r"\l", r"λ") txt = txt.replace(r"\L", r"Λ") txt = txt.replace(r"\m", r"ν") txt = txt.replace(r"\M", r"Μ") txt = txt.replace(r"\n", r"ν") txt = txt.replace(r"\N", r"Ν") txt = txt.replace(r"\o", r"ο") txt = txt.replace(r"\O", r"Ο") txt = txt.replace(r"\p", r"φ") txt = txt.replace(r"\P", r"Φ") txt = txt.replace(r"\q", r"θ") txt = txt.replace(r"\Q", r"Θ") txt = txt.replace(r"\r", r"ρ") txt = txt.replace(r"\R", r"Ρ") txt = txt.replace(r"\\sim", "≈").replace(r"\s", r"σ") txt = txt.replace(r"\S", r"Σ") txt = txt.replace(r"\t", r"τ") txt = txt.replace(r"\T", r"Τ") txt = txt.replace(r"\u", r"υ") txt = txt.replace(r"\U", r"Υ") txt = txt.replace(r"\w", r"ω") txt = txt.replace(r"\W", r"Ω") txt = txt.replace(r"\x", r"χ") txt = txt.replace(r"\X", r"Χ") txt = txt.replace(r"\y", r"ψ") txt = txt.replace(r"\Y", r"Ψ") txt = txt.replace(r"\z", r"ζ") txt = txt.replace(r"\Z", r"Ζ") # process , primitive txt = txt.replace("^2^", "2") return txt def handleNA(val, ifna): if 'n/a' in val.lower(): return ifna return val registered = False if not registered: registered = True olex.registerFunction(makeSpecialCifCharacter, False, "report") olex.registerFunction(handleNA, False, "report")