This library provides functions that allow you to expand a string that contains parenthesis with numeric-values, and then expands that into an actual string value.
$ pip install expand_stringSimple example:
from expand_string import expand_string
expand_string('N3(S)N2(E3(NW))')Would result in the output:
NSSSNENWNWNWENWNWNWShell example:
python -m expand_string 'N3(S)N2(E3(NW))'Would result in the output:
NSSSNENWNWNWENWNWNWFor more details see the expand_string docstring.