A lazy-loading, seekable, remote file object using http range requests
Project description
seekablehttpfile
This project provides a file-like object that fetches parts of a file using HTTP range requests as needed.
>>> from seekablehttpfile import SeekableHttpFile
>>> from zipfile import ZipFile
>>> f = SeekableHttpFile("https://files.pythonhosted.org/packages/cb/90/599c79a248dcae6935331113649de5d75427e320efde21b583648b498584/tensorflow_intel-2.14.0-cp310-cp310-win_amd64.whl") # 284MB
>>> # use as normal, for example with ZipFile
>>> z = ZipFile(f)
>>> len(z.namelist())
9414
>>> # find out how much we actually read
>>> f.stats
{'num_requests': 4, 'optimistic_bytes_read': 256000, 'lazy_bytes_read': 1078669, 'satisfied_from_cache': 2}
License
seekablehttpfile is copyright Tim Hatch, and licensed under
the MIT license. I am providing code in this repository to you under an open
source license. This is my personal repository; the license you receive to
my code is from me and not from my employer. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file seekablehttpfile-0.0.3.tar.gz.
File metadata
- Download URL: seekablehttpfile-0.0.3.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5627c3e27dac4bcbeaac394ba51a57e5349d475887ff670eaa14fce1c0853340
|
|
| MD5 |
01bf8cc0981e47dc4595a0825239edac
|
|
| BLAKE2b-256 |
50a39460d24cad74ec7d88607ecb02a27ead42d78a299957d9eed51a2cc1af62
|
File details
Details for the file seekablehttpfile-0.0.3-py3-none-any.whl.
File metadata
- Download URL: seekablehttpfile-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1073195a02715eb099c39455ecf2c9211554e7406728a59af9d52d56ba2160a4
|
|
| MD5 |
46acf7a1a8005877030e0514b6cf476a
|
|
| BLAKE2b-256 |
d3ffbc80f151f5cdf8f71a01acc0df75cedad03a4bce28775a187ec82f0542fb
|