Skip to main content

Python package implementing the SAP2012 domestic building energy calculations

Project description


SAP2012 energy calculation method in Python.


SAP2012 is the Standard Assessment Procedure 2012, the UK Government's energy calculation method for the building regulation compliance for new dwellings.

SAP2012 is developed and published by the Building Research Establishment:

This Python package contains the calculation methods and data in the SAP2012 methodology. It allows the user to specify the inputs needed for a SAP calculation and then to run a SAP calculation based on these inputs.


Full documentation is available on ReadTheDocs here:


Available on PyPi. Download using the command pip install sap2012.

If using the Anaconda distribution, this command can be run using the Anaconda prompt.


The package is designed to represent the SAP calculation method as simply as possible, to allow for flexibility and customisation.

Each section of the SAP2012 calculation method is a separate Python function which takes the input data as a series of arguments and returns the calculation results. For example, the method for calculating ventilation rates is given in the module.

A complete SAP calculation is run using the calculate_worksheet function.

Quick Example

This example runs a complete SAP2012 calculation using the inputs as stored in the 'inputs.json' file. The example prints the model outputs of the 'SAP_rating' section of the calculations.

from sap2012 import calculate_worksheet
import json
with open('inputs.json') as f:
{'energy_cost_factor': 1.7754795340546146, 'SAP_rating_value': 75.23206049993813}

Issues & feature requests?

Please raise them on the GitHub Issues page.


All contributions welcome. Please send your pull requests.


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sap2012-0.0.1.tar.gz (36.8 kB view hashes)

Uploaded Source

Built Distribution

sap2012-0.0.1-py3-none-any.whl (43.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page