Skip to main content

基于阿里云对象存储的命令行应用

Project description

d-oss

阿里云 OSS 对象存储命令行工具。

安装

pip install -e .

首次运行时会提示输入 access_key_idaccess_key_secret,凭证会保存在 ~/.cache/d-oss/auth.json

配置

凭证文件位于 ~/.cache/d-oss/auth.json,可手动编辑或运行 oss info 查看。

使用方法

查看帮助

oss --help

列文件

# 列出所有bucket的内容
oss list

# 列出指定bucket的内容
oss list model

上传

# 上传单个文件
oss upload myfile.txt model

# 上传整个目录(保持目录结构上传,不打包)
oss upload my_folder model

下载

# 下载单个文件
oss download myfile.txt model

# 下载文件夹(以 / 结尾)
oss download my_folder/ model

# 根据前缀匹配下载(自动识别为文件夹)
oss download my_folder model

# 保存到指定目录
oss download my_folder/ model --save_dir ./output

# 覆盖已存在的文件
oss download myfile.txt model --force

删除

# 删除文件夹(以 / 结尾,精确匹配前缀)
oss delete my_folder/ model

# 根据前缀匹配删除(自动加 / 做前缀匹配)
oss delete my_folder model

# 删除单个文件
oss delete myfile.txt model

# 清空整个bucket
oss delete ALL model

获取文件URL

oss url myfile.txt model

管理凭证

# 查看当前凭证
oss info

# 清除缓存的凭证(下次运行时会重新输入)
oss clear

Bucket 说明

名称 用途 Endpoint
data 数据 oss-cn-beijing
model 预训练模型 oss-cn-beijing
asset 资源 oss-cn-beijing
corpus 语料 oss-cn-hangzhou
pipeline spaCy 管道 oss-cn-beijing

上传/下载行为说明

  • 上传目录:递归上传所有文件,保持本地目录结构(例如 my_folder/a.txt 上传到 OSS 后路径为 my_folder/a.txt
  • 下载文件夹:根据前缀匹配下载所有文件,自动重建目录结构
  • 删除:支持精确前缀和模糊前缀两种模式

Project details


Download files

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

Source Distribution

d_oss-0.4.1.tar.gz (66.9 kB view details)

Uploaded Source

Built Distribution

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

d_oss-0.4.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file d_oss-0.4.1.tar.gz.

File metadata

  • Download URL: d_oss-0.4.1.tar.gz
  • Upload date:
  • Size: 66.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for d_oss-0.4.1.tar.gz
Algorithm Hash digest
SHA256 35fc87d0548f8c8f37729edb8e6b288e07fb6857e777a809236e5f3c5db6f98b
MD5 ecfd2842c1ae839d579ed542f824f02d
BLAKE2b-256 24872fe97639689b2ba7d040fc8e61d17bb4ed9029255be06dc47e5fed3dd1fb

See more details on using hashes here.

File details

Details for the file d_oss-0.4.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for d_oss-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9223128f91b49d28dc5163e976c8b9c7359c5c4d2358e6d205bb00f801c4753
MD5 e95f516b2526d34e2485f41a9d3212d1
BLAKE2b-256 b087cb5399c5ddf5efbe8b64acf4b7319500748d726c2237f0f02fb21df9b67b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page