BoM handler#
The BoM handler provides the serialization and deserialization of BillOfMaterial objects to and from XML format. This process validates that the BoM has a valid structure, and that the XML provided is syntactically correct.
- class BoMHandler#
Handler for XML formatted BoMs, supports reading from files and strings, and serializing to string format.
New in version 2.0.
- load_bom_from_file(file_path)#
Read a BoM from a file and return the corresponding BillOfMaterials object for use.
- Parameters:
- file_path
Path
Location of the BoM XML file.
- file_path
- Returns:
- load_bom_from_text(bom_text)#
Read a BoM from a string and return the corresponding BillOfMaterials object for use.
- Parameters:
- bom_text
str
String object containing an XML representation of a BoM.
- bom_text
- Returns: