Skip to main content

Calling Tencent Cloud API in a easier way

Project description

kumori - 更自由地调用腾讯云API

Python 3

腾讯云的python sdk很冗长,而且更新不及时,甚至有些API不会出现在sdk里,用着不是很巴适。因此包装了一下腾讯云的API的调用方式,以实现调用更多API的目的。

Installation

pip install kumori

Usage

import os
from kumori.qcloud import User
# 创建一个用户
user = User(os.getenv('QCLOUD_SID'), os.getenv('QCLOUD_SKEY'), 'ap-guangzhou')
# 调用 API
resp = user.cvm.DescribeInstances(Limit=20, Offset=0)
print(resp)

默认情况下,如果API返回Error、代码将会抛出Exception。可以通过 console.suppress_errors() 屏蔽掉

from kumori.qcloud import console

with console.suppress_errors():
    # 不会抛出异常
    resp = user.cvm.DescribeInstances(Unknown="Key")
# 这里会抛出异常
user.cvm.DescribeInstances(Unknown="Key")

Advanced

kumori 内置了 cvm 在内的若干个产品的调用。如果你想要调用的产品在这里没出现,可以手动添加:

from kumori.qcloud import console, User

console.add_service('abc', '2025-04-29')

user = User(
  # sid=...
  # skey=...
)

user.abc.DescribeYourPPT(Limit=10, Offset=2)

TODO

  • v3 signature
  • cos

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

kumori-0.0.4.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

kumori-0.0.4-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file kumori-0.0.4.tar.gz.

File metadata

  • Download URL: kumori-0.0.4.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for kumori-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b5bde444810a04c94eb12c8d99b6c5608df1aefb31346d894910f100fa76a3bb
MD5 f3d3fab5d07aaffe3bdd7086312d6945
BLAKE2b-256 09045d74f780d127efb6fbe92d681210fdf3eaf2e2aab423eb7cc1cec00913d6

See more details on using hashes here.

File details

Details for the file kumori-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: kumori-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for kumori-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4d0437bb8ed0c0e0fbd94a3b9696f3091262cce425e78da7db408dc3c765a7e2
MD5 b17c996f7a1bd976a039ad36c85406f2
BLAKE2b-256 81e7e8bc64f328b421cfea0cc4293fd4bf987e6adcc63b645fdad8f73aba3cf7

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