def urlToFile(url, variable, dfile):
    try:
        print("Getting data from: " + str(url))
        arcpy.OPeNDAPtoNetCDF_mds(url, variable, dfile, extent, dimension, "BY_VALUE")
        return True
    except NAMDownloadException as e:
        print("Error in urlToFile: \n" + str(e.tb))
Get netcdf data from OPeNDAP URL
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/suitability/toolboxes/scripts/NAMDownload.py/urlToFile