Actually for that case, you could use JSON or one of the other formats supported by Typst (and Python). Using templating (and then parsing in Typst) for that purpose should not be necessary:
(feel free to incorporate that into your response, so that it can be the canonical complete one)