A command line tool for downloading files from MinIO
Project description
mectl
mectl 是一个命令行工具,用于辅助mindedge的模型开发,例如从 MinIO 服务器下载文件。
功能特性
- 通过命令行从 MinIO 服务器下载文件
- 支持通过配置文件或环境变量设置连接参数
- 灵活的输出路径配置
- 支持指定存储桶名称
- 自动从文件路径提取文件名
- 自动检测并解压ZIP文件
安装
# 使用 pip 安装
pip install mectl
使用方法
基本用法
mectl get [OPTIONS] FILE_KEY
参数说明
FILE_KEY: MinIO 对象路径,格式:bucket_name/object_key-o, --output: 本地保存路径(默认为从 FILE_KEY 提取的文件名)-c, --config: 配置文件路径(JSON,含 oss.accessKey 等)-b, --bucket: MinIO 存储桶名称(默认为suanpan)
配置
工具需要通过配置文件或环境变量提供 MinIO 连接信息。
配置文件示例 (config.json)
{
"oss": {
"internalEndpoint": "your-minio-server.com:9000",
"accessKey": "your-access-key",
"accessSecret": "your-access-secret"
}
}
环境变量方式
export NODE_CONFIG='{"oss":{"internalEndpoint":"your-minio-server.com:9000","accessKey":"your-access-key","accessSecret":"your-access-secret"}}'
mectl get bucket-name/file-path
使用示例
# 使用配置文件下载文件
mectl get my-file.txt -c config.json -o ./local-file.txt
# 使用环境变量下载文件(自动提取文件名)
mectl get studio/100029/models/MindEdge.zip -c config.json
# 指定特定存储桶
mectl get my-file.txt -b another-bucket -c config.json
开发
本地运行
# 克隆项目
git clone <repository-url>
# 安装依赖
cd mectl
pip install -e .
发布到 PyPI
要发布新版本到 PyPI,请执行以下步骤:
- 更新 pyproject.toml 中的版本号
- 运行测试确保一切正常
- 使用发布脚本发布:
# 运行发布脚本
./release.sh
发布脚本将:
- 检查环境和依赖
- 构建包
- 询问发布目标(测试PyPI或正式PyPI)
- 执行发布
依赖
- Python >= 3.10
- minio >= 7.0.0
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
mectl-0.1.0.tar.gz
(3.9 kB
view details)
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
mectl-0.1.0-py3-none-any.whl
(4.9 kB
view details)
File details
Details for the file mectl-0.1.0.tar.gz.
File metadata
- Download URL: mectl-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.10.15 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fef48bfacc190973199db15d94c7d0cfa4a729db7381c1f69ee0d59189fc457
|
|
| MD5 |
616fd0ccb07b63da631afda79898cee3
|
|
| BLAKE2b-256 |
d0e7862a5c140e94cb8636d42b15b28736b1f8301a9f0920bbdcaa43c8290556
|
File details
Details for the file mectl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mectl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.10.15 Linux/5.15.167.4-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91961629bc8201475f86b1380d03713b30d3deeeeadf10bc6980b996e68a131c
|
|
| MD5 |
fb0e0c7154351419ceca4213a3de96d7
|
|
| BLAKE2b-256 |
fd1b5e5f400a20d107871fd2a51b1df48637fbeb560e35bcc0ea4fdc7db8adeb
|