API reference

This is the API reference for the sap10calcs package.

Functions

Classes

sap10calcs contains hundreds of classes, one for each of the XML elements described in the RdSAP XML reference and SAP XML reference.

Below are the three starting elements for RdSAP and SAP XML files. The remaining classes are not documented here but follow a similar pattern to the three elements described below.

All classes have the following methods and properties:

copy()
Returns:

A copy of the Element.

display()
Returns:

A string of the XML document with the codes replaced by the codes and values.

Return type:

str

property sap_xml_properties: list
Returns:

A list of all SAP-related properties of the Element (read-only).

property sap_xml_methods: list
Returns:

A list of all SAP-related methods of the Element (read-only).

property sap_xml_codes: dict
Returns:

A dictionary of the SAP-related codes used by the Element (read-only).

Elements with text values also have the following methods and attributes.

property code

A setter and getter for the text of the Element. When setting the text, this will raise an error if the text does not one of the codes as specified in the schema.

property value

Similar to the code property but uses the values rather than codes.

The remaining methods and properties of the classes are then used to either add or return the child Elements. An additional property is also present to return the parent Element.

class sap10calcs.classes_RdSAP_Schema_21_0_0.RdSAP_Report

Represents a RdSAP-Report element.

This is a subclass of a lxml Element, providing additional properties and methods to the Element as listed below:

add_calculation_software_name()
add_calculation_software_version()
add_user_interface_name()
add_schema_version_original()
add_schema_version_current()
add_sap_version()
add_pcdf_revision_number()
add_energy_assessment()
add_previous_epc_check()
add_sap_data()
add_report_header()
add_insurance_details()
add_externaldefinitions_revision_number()
property calculation_software_name
property calculation_software_version
property user_interface_name
property schema_version_original
property schema_version_current
property sap_version
property pcdf_revision_number
property previous_epc_check
property energy_assessment
property sap_data
property report_header
property insurance_details
property externaldefinitions_revision_number
class sap10calcs.classes_SAP_Schema_19_1_0.SAP_Report

Represents a SAP-Report element.

This is a subclass of a lxml Element, providing additional properties and methods to the Element as listed below:

add_schema_version_original()
add_schema_version_current()
add_sap_version()
add_sap_data_version()
add_pcdf_revision_number()
add_calculation_software_name()
add_calculation_software_version()
add_user_interface_name()
add_user_interface_version()
add_report_header()
add_energy_assessment()
add_sap10_data()
add_pdf()
add_insurance_details()
add_externaldefinitions_revision_number()
property sap_compliance_report
property schema_version_original
property schema_version_current
property sap_version
property sap_data_version
property pcdf_revision_number
property calculation_software_name
property calculation_software_version
property user_interface_name
property user_interface_version
property report_header
property energy_assessment
property sap10_data
property pdf
property insurance_details
property externaldefinitions_revision_number
class sap10calcs.classes_SAP_Schema_19_1_0.SAP_Compliance_Report

Represents a SAP-Compliance-Report element.

This is a subclass of a lxml Element, providing additional properties and methods to the Element as listed below:

add_sap_report()
add_client_name()
add_client_company()
add_client_address()
add_is_multiple_compliance()
property sap_report
property client_name
property client_company
property client_address
property is_multiple_compliance