parseidf module

parseidf.py

parses an idf file into a dictionary of lists in the following manner:

each idf object is represented by a list of its fields, with the first field being the objects type.

each such list is appended to a list of objects with the same type in the dictionary, indexed by type:

{ [A] => [ [A, x, y, z], [A, a, b, c],
[B] => [ [B, 1, 2], [B, 1, 2, 3] }

also, all field values are strings, i.e. no interpretation of the values is made.

Note

Use eppy instead!

parseidf.p_error(p)[source]
parseidf.p_idffile(p)[source]

idffile : idfobjectlist

parseidf.p_idfobject(p)[source]

idfobject : objectname SEMICOLON

parseidf.p_idfobject_with_values(p)[source]

idfobject : objectname COMMA valuelist SEMICOLON

parseidf.p_idfobjectlist(p)[source]

idfobjectlist : idfobject

parseidf.p_idfobjectlist_multiple(p)[source]

idfobjectlist : idfobject idfobjectlist

parseidf.p_objectname(p)[source]

objectname : VALUE

parseidf.p_valuelist(p)[source]

valuelist : VALUE

parseidf.p_valuelist_multiple(p)[source]

valuelist : VALUE COMMA valuelist

parseidf.parse(input)[source]

parses a string with the contents of the idf file and returns the dictionary representation.

parseidf.t_COMMENT(t)[source]

[ trn]*!.*

parseidf.t_VALUE(t)[source]

[ t]*([^!,;n]|[*])+[ t]*

parseidf.t_error(t)[source]
parseidf.t_newline(t)[source]

[ t]*(r?n)+