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.1.tar.gz (5.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.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: huace_aigc_frame-0.1.1.tar.gz
  • Upload date:
  • Size: 5.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.1.tar.gz
Algorithm Hash digest
SHA256 fb2cd1f884ae1eae1aa6eba4e9001e86be013a756ec91765b868119e6ef99a33
MD5 7c4534d30504bad9dba6272ef25833bc
BLAKE2b-256 72a55844f2e8041b7aeb0d28812e1abc0dae3930afac4e4487e705b1747b7918

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for huace_aigc_frame-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4928859b51b2ea51f589de61e874f1d6ef657cfa86013a47167a7ce60854a916
MD5 6193c55c91da23ac5abd8a6f5eebee82
BLAKE2b-256 303193292dec19dbb3c2168ecba5773b4107cff8d869d23ea986a6a7ac1c7a24

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