Ranged read file access abstraction.
Project description
Net-file ranged read file access abstraction library
net-file allows you to access files by URL the same way for different types of storage:
- local files
- files served by http(s) servers like Nginx
- files on SFTP
- ...
Second major feature of net-file is ranged access. So you can download only part of file starting from arbitrary position.
API
open_url(
url: str, # File URL. For local file use file:///absolute/file/path
start_bytes: int = None, # For ranged access - the beginning of the range
length: int = None # For ranged access - range length
) -> NetFile
Opens URL returning NetFile object. To read from file use context manager or open() / close()
methods pair of NetFile object:
with open_url(
url='http://test.domain/example.mp4',
start_bytes=10000,
length=20000,
) as open_file:
content = open_file.read()
while content:
content = open_file.read()
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
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 net-file-1.1.6.tar.gz.
File metadata
- Download URL: net-file-1.1.6.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fda0116974c7d62667db93520f23c343617f916ccb437db5f0b9e7694a0e0bea
|
|
| MD5 |
9fe8fdcc1b77e94d9ed728bf2ee05112
|
|
| BLAKE2b-256 |
7f5d3dc6d27e71e9f0732cf7f4458ed9fa0dd451d7e762d8a1c07017e9b7718c
|
File details
Details for the file net_file-1.1.6-py3-none-any.whl.
File metadata
- Download URL: net_file-1.1.6-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2c28c6c3d9257a59f9849f03f606590f2e59c7f31c31f58138cdc6fbcc8e7ab
|
|
| MD5 |
3b6f3b3ed13581c18fa59856b3960503
|
|
| BLAKE2b-256 |
7014543f283c0d73ddb34ad69d6ac8a6868aed9144d4188b2f9ac65d4adc2548
|