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:

  1. Petrinet Object, encoded as a PetriNet class

  2. Initial Marking

  3. Final Marking

Return type:

Tuple[PetriNet, Marking, Marking]

Parameters:
  • file_path (str) – file path of the Petri net model (.pnml file) on disk

  • encoding (str) – the encoding to be used (default: utf-8)

import pm4py

pn = pm4py.read_pnml("<path_to_pnml_file>")