Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Golang Package - sh
sh is a shell parser, formatter, and interpreter. Supports POSIX Shell, Bash, and mksh. Requires Go 1.17 or later.
Python Package - shlex
shlex makes it easy to write lexical analyzers for simple syntaxes resembling that of the Unix shell.
Python Package - bashlex
bashlex is a Python port of the parser used internally by GNU bash.