ETransfer
面向大文件场景的高性能传输工具,基于 TUS 协议。支持断点续传、切片上传下载、流式中继(上传未完成即可下载)、阅后即焚,适用于 AI 训练数据集、模型权重等大文件的可靠分发。
特性
- 基于 TUS 协议的断点续传,网络中断自动恢复
- 切片上传/下载,支持部分下载(流式中继)
- 阅后即焚 / TTL 过期 / 永久保存三种文件策略,且永久保存可由服务端策略关闭
- 离线下载(remote-download):服务端代下载 HuggingFace / 直链 / GDrive 等
- 插件化的 Source(下载源)+ Sink(推送目标,支持 S3 / TOS / 自建对象存储)
- 存储配额管理,超限自动等待并恢复
- 多 IP 负载均衡,自动选择最优节点
- OIDC 用户系统,基于角色/群组的配额控制
- CLI + GUI + Python API
安装
pip install etransfer
如需部署服务端(含 SQLAlchemy async 依赖):
pip install "etransfer[server]" --only-binary greenlet
--only-binary greenlet确保只安装预编译 wheel,避免 Windows 等平台上的 C 编译问题。
快速开始
CLI 入口同时提供
etransfer与短别名et。下文统一使用et。
# 配置服务器地址(也可通过 ETRANSFER_SERVER 环境变量)
et setup your-server
# 登录(如果服务器启用了 OIDC)
et login
# 上传:默认 download_once(阅后即焚)
et upload ./model-weights.bin
# 上传保留:永久保存(如果服务端开启了该策略)
et upload ./dataset.tar.gz --retention permanent
# TTL 过期
et upload ./snapshot.tar --retention ttl --retention-ttl 3600
# 多线程加速 + 自定义切片
et upload ./large.iso -j 8 -c $((16*1024*1024))
# 上传到本地,同时流式推送到对象存储 sink
et upload ./model.bin --sink tos
et upload ./model.bin --sink zos
et upload ./model.bin --sink zos --sink-param bucket=my-zos-bucket --sink-param prefix=models
# 下载
et download <file_id> -p ./output/
# 文件 / 目录管理
et list
et folders list
et folders download <folder_id> -p ./out/ # 整目录打包 zip
et folders delete <folder_id>
# 离线下载(服务端代下载)
et remote-download https://example.com/file.zip
et remote-download https://example.com/file.zip --sink tos -w
et remote-download https://example.com/file.zip --sink zos -w
et remote-download https://example.com/file.zip --sink zos --sink-config-file zos.yaml -w
et remote-download https://huggingface.co/gpt2 --sink tos # 整 repo 自动展开
# 任务管理
et tasks list
et tasks cancel <task_prefix>
et tasks retry <task_prefix> --wait
et tasks watch <task_prefix> # 实时查看进度
et tasks wait <task_prefix>
# 插件 / Sink / Source 浏览
et plugins
et sinks
et sources
# 服务器信息 / 热重载(admin token)
et info
et server reload
完整命令面板见 et --help,按功能分组:Setup / Files / Folders / Offline / Plugins / Server。
进阶使用(Python API)
from etransfer.client.tus_client import EasyTransferClient
from etransfer.client.downloader import ChunkDownloader
# 上传
with EasyTransferClient("http://your-server:8765", token="your-token") as client:
uploader = client.create_uploader("./large-model.bin", retention="download_once")
uploader.upload(wait_on_quota=True)
file_id = uploader.url.split("/")[-1]
# 下载
downloader = ChunkDownloader("http://your-server:8765", token="your-token")
downloader.download_file(file_id, "./output/large-model.bin")
服务端策略:关闭永久保存
如果你的服务端只想把磁盘当成中转,可以在 config.yaml 中关闭 permanent 策略:
retention:
default: download_once
allow_permanent: false # 普通用户被拒绝;API token / admin 可继续使用
/api/info会自动从retention_policies中剔除permanent- 前端 Upload 页 / Guide 页会隐藏该选项并提示「已被服务器策略禁用」
- 普通会话用户提交
retention=permanent会拿到 HTTP 403 - 静态 API token 调用方(包括 CLI
--token)按管理员处理,仍可强制使用
该字段属于热重载字段,et server reload 即时生效。
插件架构
ETransfer 自带 Source(离线下载源)+ Sink(推送目标)两类插件:
- 内置 Source:
direct、huggingface、gdrive - 内置 Sink:
local、tos(火山引擎 TOS) - 通过
entry_points注册第三方插件,开发请参考etransfer/plugins/base_*.py
文档
| 文档 | 说明 |
|---|---|
| 私有化部署 | 服务端安装、配置、Docker 部署 |
| 通信设计 | API 端点与协议说明 |
License
Metadata
Release files for etransfer 0.1.26
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| etransfer-0.1.26.tar.gz | 215.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| etransfer-0.1.26-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 430.2 kB
Release files / etransfer-0.1.26.tar.gz
| Download URL | etransfer-0.1.26.tar.gz |
|---|---|
| Size | 215.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e34d536e0c1dea707f3c7371c04b8df23955c19a42f7c7570c0827df497b5a4f
|
|
BLAKE2b-256 checksum How to use checksums |
36ffdb2d835adbeb076bcb51544dc13952cb2c54f8a42816827de3cf6f6df4d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.
Transparency logRelease files / etransfer-0.1.26-py3-none-any.whl
| Download URL | etransfer-0.1.26-py3-none-any.whl |
|---|---|
| Size | 214.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
572f8ceb76e8300e6a09f34f921fc029d17d8bd43e32bcbf22ab6520d60fd1b6
|
|
BLAKE2b-256 checksum How to use checksums |
87e85d5379a5bd74f2a3717991b8229051a8e99ae324b52cdf01841d56e4ff1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.
Transparency log