mrio_toolbox.extractors.figaro.figaro_downloader

Download Figaro 25ed from the CIRCABC website.

@author: wirth

Functions

wait_for_download(file_path[, timeout])

Wait until the given file has been fully downloaded.

get_driver(destination[, headless, prefer])

Try to get a Selenium driver. Falls back to Chrome if Firefox is not available.

safe_click(driver, by, value[, description])

Safely clicks an element on the page, handling exceptions and logging errors.

download_figaro(year, destination[, format, sut, headless])

Downloads the specified format of the EU input-output matrix from Figaro.

Module Contents

mrio_toolbox.extractors.figaro.figaro_downloader.wait_for_download(file_path, timeout=60)[source]

Wait until the given file has been fully downloaded.

Parameters:
  • file_path (str) – The path to the file that is being downloaded.

  • timeout (int) – Maximum time to wait for the download to complete, in seconds.

mrio_toolbox.extractors.figaro.figaro_downloader.get_driver(destination, headless=True, prefer='chrome')[source]

Try to get a Selenium driver. Falls back to Chrome if Firefox is not available.

Parameters:
  • destination (str) – Download folder for browser.

  • headless (bool) – Run browser in headless mode.

  • prefer (str) – Preferred browser: “firefox” or “chrome”.

mrio_toolbox.extractors.figaro.figaro_downloader.safe_click(driver, by, value, description='element')[source]

Safely clicks an element on the page, handling exceptions and logging errors.

mrio_toolbox.extractors.figaro.figaro_downloader.download_figaro(year, destination, format='industry by industry', sut=False, headless=True)[source]

Downloads the specified format of the EU input-output matrix from Figaro.