Skip to main content

华策AIGC框架 - 阿里云OSS工具包

Project description

Huace AIGC Frame

华策AIGC框架 - 阿里云OSS工具包

安装

pip install huace-aigc-frame

使用方法

配置环境变量

export OSS_ENDPOINT=your-endpoint
export OSS_ACCESS_KEY_ID=your-access-key-id
export OSS_ACCESS_KEY_SECRET=your-access-key-secret
export OSS_BUCKET_NAME=your-bucket-name
export OSS_URL_EXPIRE=604800  # 可选,默认7天

基本使用

from huace_aigc_frame import OSSUtil

# 初始化
oss = OSSUtil()

# 上传文件
result = oss.upload_file_with_task_info(
    file="path/to/file.txt",
    task_id="task123",
    task_type="image",
    file_name="result.txt"
)
print(result["url"])

# 下载文件
local_path = oss.download_file("https://bucket.endpoint/path/to/file.txt")

# 生成签名URL
signed_url = oss.generate_signed_url("path/to/file.txt", expiration=3600)

功能特性

  • 文件上传(支持文件路径、字符串内容、二进制内容)
  • 文件下载
  • URL生成(公开和签名)
  • 自动重试机制
  • 完善的日志记录

依赖

  • Python >= 3.7
  • oss2 >= 2.17.0

License

MIT

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

huace_aigc_frame-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

huace_aigc_frame-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file huace_aigc_frame-0.1.0.tar.gz.

File metadata

  • Download URL: huace_aigc_frame-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.8

File hashes

Hashes for huace_aigc_frame-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff4424b1ddc47b35ebe7f159e4af192ecdd0e6de5bb0b27b74095be85bde176c
MD5 a72e8c5b84cd3664306334ea0b4b2219
BLAKE2b-256 dc004f7511a04c60f667e3336fdb5661f124bbc4e8af69fc3d002e41a98b3564

See more details on using hashes here.

File details

Details for the file huace_aigc_frame-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for huace_aigc_frame-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 752f51618a8b55c12f388652b21f98ace8546489d873a72eff821a6e541119d6
MD5 ff6db34989c097c3e3bd2adbac8461f1
BLAKE2b-256 ba7494b5901b4171bec3dadc460fe22d423367d8ac0570c5a273daf6e7f05316

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