Skip to main content

nltget

轻量的 Python HTTP 文件传输工具,提供单线程下载、Range 并发下载、PUT/POST 上传、断点续传和命令行接口。

安装

pip install nltget

需要 Python 3.8 或更高版本。

命令行

nltget download https://example.com/file.zip -o file.zip
nltget download https://example.com/large.zip --worker 8 --block-size 50
nltget upload ./file.zip https://upload.example.com/file.zip
nltget info https://example.com/file.zip

运行 nltget --helpnltget <command> --help 查看完整参数。

Python API

download() 会先检查文件大小和 Range 支持:超过 10 MiB 且服务器支持 Range 时并发下载,否则使用单线程。

from nltget import download

ok = download(
    "https://example.com/file.zip",
    "./downloads/file.zip",
    overwrite=True,
)

也可以显式选择下载方式:

from nltget import multi_thread_download, simple_download

simple_download(url, filepath, chunk_size=64 * 1024)
multi_thread_download(url, filepath, worker_num=8, block_size=50)

上传支持 PUT 和 multipart POST:

from nltget import single_upload

single_upload(upload_url, filepath, method="PUT")
single_upload(upload_url, filepath, method="POST")

所有公开 API 均返回 bool。常用参数:

参数 单位 说明
worker_num 并发下载线程数
block_size MiB 多线程下载分块大小
chunk_size 字节 单线程下载或上传读取块大小
max_retries 失败后的最大重试次数
timeout HTTP 请求超时
headers - 自定义 HTTP 请求头
auth - requests 认证对象,包括 Digest 认证

许可证

Apache-2.0

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

nltget-1.1.61-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file nltget-1.1.61-py3-none-any.whl.

File metadata

  • Download URL: nltget-1.1.61-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nltget-1.1.61-py3-none-any.whl
Algorithm Hash digest
SHA256 3b41d2073371c0593b4107161fcfcbfa26a107fe3e4fd9fea0c56feb816c18a1
MD5 cd3bb3b1ba2c0feb532cc5e72f28dff1
BLAKE2b-256 dd8e56795ef903bcc7f7d64fe1fb1dd93364adb511dc03ea075d177841b7eb79

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.63

1 file

1.1.62

1 file

This release

1.1.61 This release

1 file

1.1.60

1 file

1.1.59

1 file

1.1.58

1 file

1.1.57

1 file

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