chemicalchecker.util.download.download.Downloader

class Downloader(url, data_path, tmp_dir=None, dbname=None, file=None)[source]

Bases: object

Downloader class.

Initialize a Download instance.

Download from url, unpack in tmp_dir, and copy to data_path. We allow wild-char in url only for FTP links. We resolve the link and make sure there is only one file matching the regex.

Parameters:
  • url (str) – The external link to a file.

  • data_path (str) – Final destination for downloaded stuff.

  • tmp_dir (str) – Temp download path, from config by default.

Methods

download

Perform the download.

validate_url

Validate and check if url is working.

download()[source]

Perform the download.

static validate_url(url)[source]

Validate and check if url is working.