probably some of you know https://pencilcode.net - editor which can map Code: Blocks<-->Text (both ways!)
which is based on https://github.com/droplet-editor/droplet
Currently works with JS and CoffeeScript (in browser)
And has some ideas for Py (Based Sculpt AST) as well https://ideas.pencilcode.net/
It would be flexible approach for beginners...