跳转到主要内容

与Vuforia Web Services (VWS) API交互的认证和授权工具。

项目描述

Build Status codecov PyPI Documentation Status

VWS Auth Tools

与Vuforia Web Services (VWS) API交互的认证和授权工具。

安装

pip install vws-auth-tools

此版本已在Python 3.12+上进行了测试。

用法

from urllib.parse import urljoin

import requests
from vws_auth_tools import authorization_header, rfc_1123_date

request_path = '/targets'
content = b''
method = 'GET'
date = rfc_1123_date()
authorization_header = authorization_header(
    access_key='my_access_key',
    secret_key='my_secret_key',
    method=method,
    content=content,
    content_type='',
    date=date,
    request_path=request_path,
)

headers = {'Authorization': authorization_header, 'Date': date}

response = requests.request(
     method=method,
     url=urljoin(base='https://vws.vuforia.com', url=request_path),
     headers=headers,
     data=content,
 )

assert response.status_code == 200, response.text

完整文档

查看完整文档

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装软件包的信息。

源代码发行版

vws_auth_tools-2024.7.12.tar.gz (19.1 kB 查看哈希)

上传于 源代码

构建分发

vws_auth_tools-2024.7.12-py2.py3-none-any.whl (5.3 kB 查看哈希值)

上传于 Python 2 Python 3

由以下支持