PySAM is a Python package that you can use in your Python code to make calls to the SAM Simulation Core (SSC) compute modules. It provides access for tools for accessing SAM default values and input variables so you can create code directly in Python without having to run SAM's code generator.
- Provides a wrapper around the SAM library that groups together the C API functions by technology or financial model into modules.
- Includes error-checking, explicit input and output definition, and conversion between Python data types.
- PySAM modules are compatible with PySSC, which is included as a subpackage. PySSC is the original wrapper used by SAM's code generator.
- Automatically assign default values to input parameters from SAM's default value database.
- Built-in documentation of models and parameters.
- Minimum Python 3.5 for Windows 7 64-bit, MacOSX 10.6, or CentOS 5.
For more information:
PySAM Workshop 2020
- Presentation slides (PDF 1.9 MB)
- Jupyter notebook used for examples
- Question and answer transcript (PDF 71 KB)
- Command to install Development version used for examples pip install nrel-pysam==2.1.5.dev3
PySAM Webinar 2019
This overview presented on August 2, 2019 demonstrates how to use PySAM to build a renewable energy system model in Python using PySAM.
Note. The examples in this video use PySAM 1.2 with pvwattsv5. The example script provided here will not work with newer versions of PySAM with pvwattsv7. For more up-to-date examples, see the PySAM documentation.