Skip to main content

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.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

tos_decrator-0.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file tos_decrator-0.2.tar.gz.

File metadata

  • Download URL: tos_decrator-0.2.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

Hashes for tos_decrator-0.2.tar.gz
Algorithm Hash digest
SHA256 73cbf502b620d6d04a424d469b2857f1f750d59194bce05eb8d4d2e29bf58e59
MD5 09fb1b08345c22b17bec349e2074f140
BLAKE2b-256 58b9229001745396a35624bdf9b91d22bc48c1c04415bc7e847b917027f09fa5

See more details on using hashes here.

File details

Details for the file tos_decrator-0.2-py3-none-any.whl.

File metadata

  • Download URL: tos_decrator-0.2-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

Hashes for tos_decrator-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1033b271ed606fb6851246afdb7d47a0c7d4957a80a00ce1d499a71fae49e3c3
MD5 5b14837fbc2e68f89ad98f172f597778
BLAKE2b-256 641ee365297e30acb8c9bea4ea158b1a04b148bed638f60a487b26bba08744dc

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