Skip to main content

Lazily reading a file from a url. Allows random access via http range requests.

Project description

urlfile

Lazily reading a file from a url. Allows random access via http range requests so that not the whole file has to be downloaded first.

Example Usage

import urlfile
import zipfile

with zipfile.ZipFile(urlfile.UrlFile(url=...)) as f:
  f.printdir()

Caching

Buffering and caching is provided via urlfile.BufferedUrlFile.

f = urlfile.BufferedUrlFile(url=..., cache_size_bytes=...)

By default, uses a cache size of 10MB.

Other options

These are arguments of UrlFile/BufferedUrlFile

  • verbose: whether to show progress bars during fetching of data (using tqdm, default: False)
  • session: a requests.Session to use (default: None, creates a new session)

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

urlfile-1.0.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

urlfile-1.0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file urlfile-1.0.1.tar.gz.

File metadata

  • Download URL: urlfile-1.0.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for urlfile-1.0.1.tar.gz
Algorithm Hash digest
SHA256 684f260c7fdd3ad7264beb853b1ff775f348e4f5444978dac0049b51b593169a
MD5 cb9021e7d8dc6c8ea5b59ecb7b58156f
BLAKE2b-256 ec94130c17d9942aa90d9f60dbbb0f04048a91389c1046d18dced1205f1c392f

See more details on using hashes here.

File details

Details for the file urlfile-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: urlfile-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for urlfile-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9dc7d81d915c90189745ffd8ec81fc31aaf2e7ec705770984bf92cb33a47206
MD5 25fb594d1f95074a186e87feae011f94
BLAKE2b-256 a5aec8521f2f9abde660e3aca90172f887ad1650fb998c86f91c377de9f4cb96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page