Parser#
- class Parser(filename, mode='r')[source]#
Bases:
ABC
Base class for structure file parsers.
Classes inheriting from
Parser
need to define aparse_input
method that accepts a list of lines and returns a dictionary representation of the data.Methods
Parser.get
(key, default)Retrieve a value from the internal data using a given key.
List items available in internal dictionary.
List keys available in internal dictionary.
Parser.parse_input
(lines)Parse a list of lines from a file and convert the data into a dictionary.
List values available in internal dictionary.