A simple tos decrator to download file,process and upload
Project description
Simple decrator of tos download,process and upload
Usage:
from PIL import Image
@tos_process_decorator()
def process_data(local_file_path, *args, **kwargs):
# 这里进行数据处理
# 假设处理后的数据保存在临时文件中
test_png = Image.open(local_file_path)
return test_png
# 调用装饰过的函数
object_key = 'rendering/cam15/02a5ac47db6e09d5235bea600068dd0cdad7682dfa265d7052c247e3d21abf88/View5_SceneDepth.png'
tos_prefix = 'rendering/cam15/02a5ac47db6e09d5235bea600068dd0cdad7682dfa265d7052c247e3d21abf88/'
output_key = 'View5_SceneDepth_test.png'
suffix = '.png'
process_data(object_key=object_key,suffix=suffix, tos_prefix=tos_prefix, output_key=output_key)
#如果不需要上传操作,仅需要返回处理后的文件(是一个路径),传入upload=False,此时最简单的应用方式:
process_data(object_key=object_key,upload=False)
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
tos_decrator-0.3.tar.gz
(3.0 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
File details
Details for the file tos_decrator-0.3.tar.gz.
File metadata
- Download URL: tos_decrator-0.3.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e60114bfe29c3b5c384881f65cf6dd7b80460e395b0b893f7e91444b3f963ec
|
|
| MD5 |
3e2752f2d10c049736d4a3c16eda3c6b
|
|
| BLAKE2b-256 |
6f8dbd29aa832234d3e73280d7cb47ecd94169e96fe676240c002fffc4617f09
|
File details
Details for the file tos_decrator-0.3-py3-none-any.whl.
File metadata
- Download URL: tos_decrator-0.3-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93580631799e7c314e6d2a1d12288e4d06fa47c63898846e6dbfed128ea0cac5
|
|
| MD5 |
1b50ae16eefaaf6622544bd8efda8d73
|
|
| BLAKE2b-256 |
566d0f542fd9d91081b0de76b0123a40b683f8c47f1d83090169ad814e1d6cd8
|