Module Expr Str Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body Expr Str decorator_list FunctionDef arguments args NameParam defaults body Return BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return BinOpAdd Str Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad Str attr Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Index Num Assign NameStore ListComp Call NameLoad NameLoad NameLoad NameLoad comprehension NameStore Call NameLoad Num BinOpAdd NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd BinOpAdd NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Raise Call NameLoad NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If NameLoad body Print BinOpAdd Str NameLoad With Call AttributeLoad NameLoad attr NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore ListComp Call NameLoad NameLoad comprehension NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Num Assign NameStore Num Assign NameStore Call NameLoad NameLoad NameLoad For NameStore NameLoad body TryExcept body AugAssignAdd NameStore Call NameLoad NameLoad NameLoad AugAssignAdd NameStore Num handlers ExceptHandler type NameLoad body Continue Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr If CompareEq Call NameLoad AttributeLoad NameLoad attr Call NameLoad Str body Assign NameStore Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad Print BinOpMod Str TupleLoad NameLoad BinOpDiv NameLoad Num NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A 
Wikipedia Picture of the Day (POTD) download example

Baseline synchronous example for comparison: downloads metadata and
images in the simple but slow synchronous way i.e. one after the other.
 N/A calendar N/A datetime N/A re N/A os N/A io N/A time N/A requests N/A argparse N/A SAVE_DIR pictures/ N/A POTD_BASE_URL http://en.wikipedia.org/wiki/Template:POTD/ NoPictureForDate N/A Exception N/A N/A No Picture of the Day found for {day} N/A build_page_url N/A N/A iso_date N/A N/A N/A N/A POTD_BASE_URL iso_date N/A fetch N/A N/A url N/A N/A N/A response N/A N/A requests get url N/A response N/A extract_image_url N/A N/A html N/A N/A N/A re_image src="(//upload\..*?)" N/A image_url N/A N/A re search re_image html N/A N/A http: N/A N/A image_url group 1 N/A format_date N/A N/A year month day N/A N/A N/A N/A N/A {year}-{month:02d}-{day:02d} format N/A locals N/A list_days_of_month N/A N/A year month N/A N/A N/A lastday N/A N/A N/A calendar monthrange year month N/A 1 N/A days N/A N/A format_date year month day N/A day N/A range 1 N/A lastday 1 N/A days N/A build_save_path N/A N/A iso_date url N/A N/A N/A N/A head filename N/A N/A N/A os path split url N/A N/A N/A N/A os path join SAVE_DIR N/A N/A iso_date _ filename N/A save_one N/A N/A iso_date verbose N/A N/A N/A page_url N/A build_page_url iso_date N/A response N/A fetch page_url N/A N/A N/A response status_code 200 N/A N/A msg N/A N/A N/A NoPictureForDate __doc__ format day iso_date N/A N/A NoPictureForDate msg N/A img_url N/A extract_image_url N/A response text N/A response N/A fetch img_url N/A path N/A build_save_path iso_date img_url N/A verbose N/A N/A N/A saving:  path N/A N/A N/A io open path wb fp N/A N/A N/A N/A fp write N/A response content N/A N/A len N/A response content N/A save_month N/A N/A year_month verbose N/A N/A N/A N/A year month N/A N/A int s N/A s N/A N/A year_month split - N/A total_size 0 N/A img_count 0 N/A dates N/A list_days_of_month year month N/A date dates N/A N/A N/A N/A total_size N/A save_one date verbose N/A img_count 1 N/A N/A N/A NoPictureForDate N/A N/A N/A N/A img_count total_size N/A main N/A N/A save_one save_month N/A save_one save_month N/A N/A Get "Picture of The Day" from English Wikipedia for a given date or month N/A parser N/A N/A argparse ArgumentParser description N/A main __doc__ N/A N/A N/A parser add_argument date help year, month and (optional) day in YYYY-MM-DD format N/A N/A N/A parser add_argument -q --max_qty type int help maximum number of files to download N/A N/A N/A parser add_argument -v --verbose action store_true help display progress information N/A args N/A N/A parser parse_args N/A t0 N/A N/A time time N/A N/A N/A len N/A args date N/A len YYYY-MM-DD N/A N/A img_count 1 N/A total_size N/A save_one N/A args date N/A args verbose N/A N/A N/A img_count total_size N/A save_month N/A args date N/A args verbose N/A elapsed N/A N/A N/A time time t0 N/A N/A images: %3d |  total size: %6.1f Kbytes  |  elapsed time: %3ds N/A img_count N/A total_size 1024.0 elapsed N/A N/A N/A __name__ __main__ N/A N/A N/A main