Note: This documents the usage of both the perl and the python version. I have made the perl and python version work as alike as I could. In order to not favoritize either side hashes/dictionaries are called "associative arrays" and depicted as JSON objects in all their ugliness! :-)
The string2attrs function parses a string, e.g. a title string from a Pandoc Link or Image element, with attributes similar to those used with Pandoc Code, CodeBlock and Header elements (minus the braces) into an associative array of key--value pairs. Something like
"#foo .bar lang=la baz='biz buz'"
becomes
{"baz":"biz buz","id":"foo","lang":"la","class":"bar"}