Skip to main content

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': 2, 'optimistic_bytes_read': 256000, 'lazy_bytes_read': 1078669, 'satisfied_from_cache': 2}

Version Compatibility

Users of this library should be able to use Python 3.7 or above. This is validated by tests, and is the version encoded in Requires-Python.

Development requires Python 3.12 (or 3.13), realistically. CI validates that it works on 3.10 and above, but you will get less checking in flake8. Expect older versions to be dropped as soon as there is a version of mypy, black, etc that is not simultaneously compatible with all development versions.

Notably, this means that while this project might function (and pass tests) on Python 3.7, it's likely that you can't typecheck against it.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seekablehttpfile-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seekablehttpfile-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file seekablehttpfile-0.1.1.tar.gz.

File metadata

  • Download URL: seekablehttpfile-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for seekablehttpfile-0.1.1.tar.gz
Algorithm Hash digest
SHA256 393a6391996f57402047983e0020303f933b8e6c8683e5111e754c8e9eea3c84
MD5 b5570cb289b52179041b08d8ed771108
BLAKE2b-256 4e8b2088a9ba14f31052aebd20c77f93e2f2229918b787e4ab4f1a1fec272b4e

See more details on using hashes here.

File details

Details for the file seekablehttpfile-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for seekablehttpfile-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a640881cfef60f02e2df55328b5bc8296bd2fa4ef08dcaecc7fa3a05ba230b0
MD5 1f72c90356b4499956683afb0e95b804
BLAKE2b-256 7d9432231a20a3324103166ae6f9d9d30d8f3ff1f482633c0a4d88b5b6a422f2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page