pm4py.read.read_pnml#
- pm4py.read.read_pnml(file_path: str, auto_guess_final_marking: bool = False, encoding: str = 'utf-8') Tuple[PetriNet, Marking, Marking] [source]#
Reads a Petri net object from a .pnml file. The Petri net object returned is a triple containing the following objects:
Petrinet Object, encoded as a
PetriNet
classInitial Marking
Final Marking
- Return type:
Tuple[PetriNet, Marking, Marking]
- Parameters:
file_path (
str
) – file path of the Petri net model (.pnml
file) on diskencoding (
str
) – the encoding to be used (default: utf-8)
import pm4py pn = pm4py.read_pnml("<path_to_pnml_file>")