grabflickr Package

grabflickr Module

grabflickr.grabflickr.create_dir(path)

Create dir with the path

Parameters:path (str) – The path to be created
grabflickr.grabflickr.download_photo(photo)

Download a photo to the the path(global varialbe directory) :param photo: The photo information include id and title :type photo: dict

grabflickr.grabflickr.download_photo_async(photo)

Download a photo to the the path(global varialbe directory) :param photo: The photo information include id and title :type photo: dict

grabflickr.grabflickr.enter_api_key(parser=None)

Prompt for API key and secret Then write them to CONFIG_PATH(Default: ~/.grabflickr.conf)

Parameters:parser (SafeConfigParser) – Config parser
grabflickr.grabflickr.event_download_photos(photos)

Use asynchronous I/O to download photos

Parameters:photos (list of dicts) – The photos to be downloaded
grabflickr.grabflickr.get_photo_url(photo_id)

Request the photo download url with the photo id :param photo_id: The photo id of flickr :type photo_id: str :return: Photo download url :rtype: str

grabflickr.grabflickr.get_photos_info(photoset_id)

Request the photos information with the photoset id

Parameters:photoset_id (str) – The photoset id of flickr
Returns:photos information
Return type:list
grabflickr.grabflickr.init_logger()

Initialize the logger and set its format

grabflickr.grabflickr.main()

The main procedure

grabflickr.grabflickr.multithread_download_photos(photos)

Use multiple threads to download photos

Parameters:photos (list of dicts) – The photos to be downloaded
grabflickr.grabflickr.read_config()

Read the config from CONFIG_PATH(Default: ~/.grabflickr.conf) This will prompt for API key and secret if it not exists. After, it sets the global variable api_key and api_secret.

grabflickr.grabflickr.set_image_size_mode(s)

Set the quality of the images to be downloaded This set the global variable image_size_mode

Parameters:s (str) – quality level, 1 is original size, 12 is smallest
grabflickr.grabflickr.single_download_photos(photos)

Use single process to download photos

Parameters:photos (list of dicts) – The photos to be downloaded