FigshareDownloader#

class augraphy.utilities.figsharedownloader.FigshareDownloader(directory='figshare/')[source]#

Bases: object

Makes HTTP requests for images on Figshare

download_all_files_from_article(article_id)[source]#

Download every file in article_id

Parameters:

article_id (string) – ID of the Figshare article

download_file_by_id(file_id, file_name=None)[source]#

Download a single file using its unique identifier, and optionally rename it.

Parameters:

file_id – ID of the Figshare file

download_random_file_from_article(article_id)[source]#

Randomly download single file in article_id

Parameters:

article_id (string) – ID of the Figshare article

list_article_files(article_id)[source]#

Get a dictionary of files from Figshare.

Parameters:

article_id (string) – ID of the Figshare article

make_files_url(article_id)[source]#

Form the full URL for requests

make_save_dir()[source]#
send_request(url, headers)[source]#

Request Figshare data

Parameters:
  • url (string) – request endpoint

  • headers (dictionary) – header info for request

  • data (dictionary) – Figshare article data

  • binary (boolean, optional) – True if downloading images

Overview#

FigshareDownloader is the base class to manage the donwload of images or files from Figshare. It supports donwload of all images or files from an article id or just single image or file from an article id.