PourPy.parser

Classes

Parser

Helper class that provides a standard way to create an ABC using

DefaultParser

Helper class that provides a standard way to create an ABC using

Module Contents

class PourPy.parser.Parser

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstractmethod parse_reactions()
abstractmethod parse_species()
abstractmethod parse_elements()
class PourPy.parser.DefaultParser

Bases: Parser

Helper class that provides a standard way to create an ABC using inheritance.

static parse_reactions(reactions: tuple)

Parses several reactions given as tuple

Parameters:

reactions (tuple) – reactions to be parsed, each entry of a tuple is a reaction string

:return : reactions as list, each entry is a dict containing reactants :rtype : list

static parse_reaction(reaction: str)

Parse a reaction from its string representation

Parameters:

reaction (str) – reaction to be parsed

:return : reactants as dict :rtype : dict

static parse_species(species: tuple, elements: dict)
static parse_specie(specie: str)

Parse a specie and its chemical props from its string representation

Parameters:

specie (str) – specie_name,state,dGf,dHf,Sm as string

:return : name of the specie, properties as dictionary :rtype : tuple

static parse_elements()