mixnode python开发包

mixnode-py-sdk的Python项目详细描述


概述

mixnodePythonsdk允许您 轻松地将mixnode restapi集成到python应用程序中。

要求

  • Python2及以上。
  • 来自Mixnode portal上注册用户的mixnode api密钥。

安装

pip install mixnode-py-sdk

教程

按照本教程查看分步指南和如何 使用mixnode python sdk。

从mixnode门户获取api密钥

  • Mixnode上创建帐户。
  • 如果已经注册,则登录并导航到API密钥页。
  • 仪表板->;从左侧菜单中选择API->;注意API键。
  • 或者,直接导航到https://www.mixnode.com/account/api查找 你的api密钥。

认证

这个sdk附带了基于https的基本身份验证,这需要您 在 客户端实例化。

基本身份验证

这种类型的令牌直接提供给应用程序。

frommixnodeimportMixnode# Create an instance of the Mixnode Clientclient=Mixnode("Your API Key")#add your API KEY here; available at https://www.mixnode.com/account/api

注意api_key也可以作为配置中的json对象传递 文件以避免在代码中指定密钥。请看 Examples

快速启动

frommixnodeimportMixnode,MixnodeErrortry:query="SELECT url, title from homepages LIMIT 10"response=Mixnode("Your API Key").execute(query)print(response)exceptMixnodeErroraserror:print(error)

mixnode的执行功能

execute是一个同步操作,它基于 分页mixnode sql api。

execute最多可接受两个参数:query、inputlimit(可选)。

请看各种各样的 Examples 有关用法的详细信息。

frommixnodeimportMixnode,MixnodeErrortry:response=Mixnode("Your API Key").execute(query)# Do something with responseexceptMixnodeErroraserror:# Do something with error
frommixnodeimportMixnode,MixnodeErrortry:# Fires a query and also sets the input limit on the data to be scannedresponse=Mixnode("Your API Key").execute(query,inputLimit)# Do something with responseexceptMixnodeErroraserror:# Do something with error

sdk调试

打开调试模式会记录发送到 混合节点API。这对于验证正在发送的查询是否 更正或验证查询是否正在执行。

# Setting debug to true logs the state of the application.# Do not use this in production.Mixnode("Your API Key").setDebug(True);

示例:mixnode python client

Examples

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何设置分割PdfPCell的最小高度   java Apache POI pptx图像处理时间过长   如果我更改jar文件的位置,则java jar文件不拍摄图像   java如何从客户端读取领事键值?   Java函数接口中的泛型类型安全   java无法解析:E/RecyclerView:未连接适配器;正在跳过布局,并且无法为子()中的参数“pathString”传递null   java异常postGIS几何映射与JPA   hibernate初始SessionFactory创建失败。JAVAlang.NoClassDefFoundError:org/hiber-nate/cfg/Configuration   java为什么BoxLayout不能共享,而FlowLayout可以共享?   名为“undefined”的java文件在api响应中返回,spring boot   java在一个对象中只允许一个非空字段的好方法是什么   日期java SimpleDataFormat错误地解析给定的时间戳   用于实现lambda可能接口的枚举的java速记符号