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
Metadata
Release files for huace-aigc-frame 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| huace_aigc_frame-0.1.1.tar.gz | 5.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| huace_aigc_frame-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / huace_aigc_frame-0.1.1.tar.gz
| Download URL | huace_aigc_frame-0.1.1.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb2cd1f884ae1eae1aa6eba4e9001e86be013a756ec91765b868119e6ef99a33
|
|
BLAKE2b-256 checksum How to use checksums |
72a55844f2e8041b7aeb0d28812e1abc0dae3930afac4e4487e705b1747b7918
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.8
|
Release files / huace_aigc_frame-0.1.1-py3-none-any.whl
| Download URL | huace_aigc_frame-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4928859b51b2ea51f589de61e874f1d6ef657cfa86013a47167a7ce60854a916
|
|
BLAKE2b-256 checksum How to use checksums |
303193292dec19dbb3c2168ecba5773b4107cff8d869d23ea986a6a7ac1c7a24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.8
|
Security for huace-aigc-frame 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.