File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1+ import requests
2+ def download_image (url , output_image_file ):
3+ r = requests .get (url )
4+ with open (output_image_file , 'w' ) as f :
5+ if isinstance (r .content , bytes ):
6+ content = r .content .decode ()
7+ else :
8+ content = r .content
9+ f .write (content )
10+
11+ if __name__ == "__main__" :
12+
13+ download_image ("https://static.pepy.tech/personalized-badge/vectorai-nightly?period=total&units=none&left_color=black&right_color=purple&left_text=Total%20Downloads" ,
14+ "assets/total_downloads.svg" )
15+ download_image ("https://static.pepy.tech/personalized-badge/vectorai-nightly?period=week&units=none&left_color=black&right_color=purple&left_text=Weekly%20Downloads" ,
16+ "assets/weekly_downloads.svg" )
17+ download_image ("https://static.pepy.tech/personalized-badge/vectorai-nightly?period=month&units=none&left_color=black&right_color=purple&left_text=Monthly%20Downloads" ,
18+ "assets/monthly_downloads.svg" )
You can’t perform that action at this time.
0 commit comments