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://pypi-hypernode.com/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
File details
Details for the file seekablehttpfile-0.0.4.tar.gz
.
File metadata
- Download URL: seekablehttpfile-0.0.4.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d88571e44b0bd2c63df158f5c393bd73e0e606f17f9775d03ce84600c7ffd3f0 |
|
MD5 | b427df1a4294e12ca62ecdaae8206840 |
|
BLAKE2b-256 | ad8d525109c3eb2ac7cd364fe8c20c3f5bf47a8c1f6b48d2b43deeeadaf4109a |
Provenance
File details
Details for the file seekablehttpfile-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: seekablehttpfile-0.0.4-py3-none-any.whl
- Upload date:
- Size: 7.0 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 | 4f7a4dc37c7a8b13f15b4eee55fd54c9fdbd2adb153afbb9d47fa47e1e6d3257 |
|
MD5 | e4b4c1b922c9561ed64dc857e26a95b8 |
|
BLAKE2b-256 | 86eaf27b648330abff7d07faf03f2dbe8070630d2a14b79185f165d555447071 |