ladybug_rhino.download module

Collection of methods for downloading files securely using .NET libraries.

ladybug_rhino.download.download_file(url, file_path, mkdir=False)[source]

Write a string of data to file.

Parameters:
  • url – A string to a valid URL.

  • file_path – Full path to intended download location (e.g. c:/ladybug/testPts.pts)

  • mkdir – Set to True to create the directory if doesn’t exist (Default: False)

ladybug_rhino.download.download_file_by_name(url, target_folder, file_name, mkdir=False)[source]

Download a file to a directory.

Parameters:
  • url – A string to a valid URL.

  • target_folder – Target folder for download (e.g. c:/ladybug)

  • file_name – File name (e.g. testPts.zip).

  • mkdir – Set to True to create the directory if doesn’t exist (Default: False)

ladybug_rhino.download.extract_project_info(project_info_json)[source]

Extract relevant project information from project info JSON containing URLs.

Parameters:

project_info_json – A JSON string of a ProjectInfo object, which contains at least one Weather URL. If the ProjectInfo does not contain information that resides in the weather file, this info will be extracted and put into the returned object.

Returns:

A tuple with two values.

  • project_info_json: A JSON string of project information containing information extracted from the EPW URL.

  • epw_path: The local file path to the downloaded EPW.