A SDK for file downloading with resumable and multi-threaded features.
Project description
Dataset Downloader
一个支持断点续传和多线程功能的文件下载SDK。
功能特性
- 支持断点续传下载
- 多线程并发下载
- 进度条显示
- 自动重试机制
- 文件完整性校验
安装
从PyPI安装(推荐)
pip install dataset-down
开发模式安装
# 克隆仓库
git clone https://github.com/your-repo/dataset-down.git
cd dataset-down
# 构建分发包
python setup.py sdist bdist_wheel
# 安装构建好的包
pip install dist/dataset_down-0.1.0-py3-none-any.whl
# 以开发模式安装(代码修改即时生效)
pip install -e .
卸载与更新
# 卸载
pip uninstall dataset-down
# 更新到最新版本
pip install --upgrade dataset-down
# 更新到指定版本
pip install dataset-down==0.1.0
依赖包
本项目依赖以下Python包:
requests- HTTP库,用于文件下载tqdm- 进度条显示click- 命令行界面构建psutil- 系统资源监控pytz- 时区处理
安装依赖
pip install requests tqdm click psutil pytz
认证配置
在使用SDK功能前,需要先进行认证:
dataset-down login --ak YOUR_ACCESS_KEY --sk YOUR_SECRET_KEY
支持的命令
登录
dataset-down login [OPTIONS]
参数说明:
| 参数 | 是否必需 | 描述 |
|---|---|---|
--ak |
是 | Access Key |
--sk |
是 | Secret Key |
示例:
dataset-down login --ak YOUR_ACCESS_KEY --sk YOUR_SECRET_KEY
下载文件或文件夹
dataset-down download [OPTIONS]
参数说明:
| 参数 | 是否必需 | 默认值 | 描述 |
|---|---|---|---|
--dataset-id |
是 | 无 | 数据集 ID |
--version |
否 | master |
版本号 |
--source-path |
是 | 无 | 源文件路径,如果是目录则下载整个目录 |
--target-path |
否 | . (当前目录) |
目标保存路径 |
示例:
# 下载指定数据集的文件
dataset-down download --dataset-id my_dataset --source-path /path/to/file.txt --target-path /path/to/save --version master
# 下载整个目录到指定位置
dataset-down download --dataset-id my_dataset --source-path /data/dir --target-path ./local_dir --version master
停止正在运行的下载进程
dataset-down stop_running_downloading_process
断点续传
- 如果下载中断,只需重新执行相同的命令,程序会自动从断点处继续下载。
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 jsdataset_down-0.28.0-py3-none-any.whl.
File metadata
- Download URL: jsdataset_down-0.28.0-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b434f2699e2abcd9ab66afda5bb497f45a2d8ddbdce29adedacf69d0f82f0f0
|
|
| MD5 |
0587444cc8f735d9797dd9426df5f3d5
|
|
| BLAKE2b-256 |
4ad026bf1240115e876c11b834dc673245b4222858f4697d06b63f4ec375de75
|