Timeline for How to download a file over HTTP?
Current License: CC BY-SA 4.0
21 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 22, 2023 at 7:55 | comment | added | Pankaj Yadav | This link is quite useful. realpython.com/python-download-file-from-url/… | |
Feb 16, 2023 at 7:35 | comment | added | Eric Duminil |
for data in tqdm(response.iter_content(chunk_size=1024), unit='kB'): will download and write the file in chunk, and show the correct unit in the progress bar.
|
|
Feb 16, 2023 at 7:09 | comment | added | Eric Duminil | @ospider: Do you have more info? It might still be okay if it's a one-off solution. E.g. your script expects a json in input folder. If it isn't there, download it, and forget about requests next time you run the script. | |
Mar 24, 2020 at 12:30 | history | edited | Martijn Pieters | CC BY-SA 4.0 |
Fix broken requests documentation URL
|
S Feb 22, 2020 at 18:11 | history | suggested | Mark A. Ropper | CC BY-SA 4.0 |
Fix broken link
|
Feb 22, 2020 at 13:38 | review | Suggested edits | |||
S Feb 22, 2020 at 18:11 | |||||
Mar 22, 2019 at 2:55 | comment | added | ospider | Please consider not using requests for any serious application, it's not thead-safe and has a memory-leak issue. | |
Oct 4, 2018 at 15:58 | comment | added | hughdbrown | @lindhe Are you using a python version earlier than 2.7? If not, you should be able to run requests on any version you come across. | |
Oct 4, 2018 at 9:23 | comment | added | lindhe | What does 2012 mean in Python versions? | |
Oct 1, 2018 at 10:54 | comment | added | haridsv |
I think a chunk_size argument is desirable along with stream=True . The default chunk_size is 1 , which means, each chunk could be as small as 1 byte and so is very inefficient.
|
|
Sep 26, 2018 at 12:45 | comment | added | mrgloom | Progress bar not look nice. | |
Jan 17, 2016 at 18:44 | comment | added | hughdbrown |
@Ali: r.text : For text or unicode content. Returned as unicode. r.content : For binary content. Returned as bytes. Read about it here: docs.python-requests.org/en/latest/user/quickstart
|
|
Jan 1, 2016 at 8:45 | comment | added | M. Ali |
What would be the difference between r.content and r.text ?
|
|
Dec 31, 2015 at 16:45 | history | edited | hughdbrown | CC BY-SA 3.0 |
Add sample with tqdm progress bar usage
|
Nov 15, 2013 at 16:36 | comment | added | Harel | Why would a url library need to have a file unzip facility? Read the file from the url, save it and then unzip it in whatever way floats your boat. Also a zip file is not a 'folder' like it shows in windows, Its a file. | |
Aug 13, 2013 at 14:10 | comment | added | hughdbrown |
@kvance: I did not know that. This option became known as stream in v1.0.0, AFAICT. It seems to have been prefetch in earlier versions, but I have not dug into the source code enough. Try: git clone [email protected]:kennethreitz/requests.git && git log -S"self.stream" --source --all
|
|
Jul 28, 2013 at 17:14 | comment | added | kvance | It is possible to stream large files by setting stream=True in the request. You can then call iter_content() on the response to read a chunk at a time. | |
Dec 17, 2012 at 16:05 | comment | added | Bibek Shrestha | How does this handle large files, does everything get stored into memory or can this be written to a file without large memory requirement? | |
Aug 29, 2012 at 15:57 | history | edited | hughdbrown | CC BY-SA 3.0 |
Explain advantages of requests library
|
Jul 5, 2012 at 21:13 | comment | added | Abdul Muneer | how do I save or extract if the zip file is actually a folder with many files in it? | |
May 24, 2012 at 20:08 | history | answered | hughdbrown | CC BY-SA 3.0 |