Improvement for the `urllib.request.urlopen` function.
Project description
urlopen2
Description
Improvement for the urllib.request.urlopen
function.
Install
pip install urlopen2
Using
from urlopen2 import URLFile
url = "https://example.com/file.bin"
with URLFile(url) as f:
f.read(128)
# In this case, 128 bytes of the file will be loaded.
f.seek(0)
# Move the caret to the beginning of the file
data = f.read(128)
# Since we are taking the same 128 bytes that have already been loaded, they will be received from the buffer.
print(data)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
urlopen2-1.2.0.post1.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for urlopen2-1.2.0.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff913d07996a5679c9dfb8668b7352c54e556e8f2d2c29b1f09cc475b4bcb3d |
|
MD5 | c3a10bcf5aca84fb05dc74601d2b1c10 |
|
BLAKE2b-256 | d48b800ebd3760328fe53407a6ffa1bc3d5253469e1155c89fd7b7194dde11d0 |