Parser#
- class Parser(filename, mode='r', **kwargs)[source]#
Bases:
ABC
Base class for structure file parsers.
Classes inheriting from
Parser
need to define a functionParser.parse_input()
that creates a dictionary representation of the given file. The input is a deque of all lines in the file.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.