Hi John,
The PVLIB link above is to a Python library version of the DISC model that converts GHI to DNI.
As for DHI, there are a few models out there. SAM provides the option to choose from the Isotropic, HDKR, or Perez options, which are described in the SAM PV reference manual, available from here:
sam.nrel.gov/photovoltaic/pv-publications.html.
Best regards,
Paul.