I actually have a prototype of something like that, built on top of Lark. It's still far from being complete or user friendly, but I'm already successfully transpiling a subset of Python to Javascript.
It still needs a lot of handholding, but at the same time I get to use gems like -
... = TemplateTranslator({
'isinstance($a, str)': "typeof($a) == 'string'",
'isinstance($a, bool)': "typeof($a) == 'boolean'",
'len($a)': '$a.length',
'str($a)': '$a.toString()',
'getattr($a, $b)': '$a and $a[$b]',
'getattr($a, $b, $c)': '($a and $a[$b]) or $c',
'hasattr($a, $b)': '$b in $a',
'$a.join($b)': '$b.join($a)',
... })