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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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.2.1-py3-none-any.whl.
File metadata
- Download URL: tos_decrator-0.2.1-py3-none-any.whl
- Upload date:
- Size: 3.6 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 |
2cb79823fcb470c09f71bdb7a00d516c4c30f3597977b98e6571439aba41bd96
|
|
| MD5 |
ab221f669dbc07349ebeb5c969f17f75
|
|
| BLAKE2b-256 |
dce40cd703b5de47e34331ded334fb18c0ef24bb97c175af18133c43b8b18a2d
|