Is there any API for parsing ZPL, Zebra Stored Format, files?

I have seen some good functions to print fields, on a template file, like


Where you send in pairs of field number and field value. I have the opposite problem, I want to read all the fields and names form a ZPL template file, zebra stored format. Is there any API for that? Like a get field and you get a dictionary with all field numbers and field name pairs. (not the value of course, but the friendly name of the field, if it exists in the file).