用于python的rehive sdk

rehive的Python项目详细描述


更新python sdk

一种主要用于快速连接rehive api的工具。

安装

pip install rehive

文档

有关更深入的api详细信息,请访问:http://docs.rehive.com/

示例和如何

fromrehiveimportRehive,APIExceptionrehive=Rehive()# OR Rehive(API_TOKEN_HERE)

您可以分析一个api令牌,或者在手动登录时留空。每个对象实例将存储它自己的令牌并充当另一个用户。

sdk将默认为live api。要轻松切换到暂存,有一个网络标志:

rehive=Rehive(network='staging')

登录:

rehive.auth.login(user="test@rehive.com",company="test_company",password="12345678")

获取:

rehive.admin.accounts.get()

获取嵌套对象:

rehive.admin.accounts.obj('5AT24mW61H').currencies.get()

使用筛选器获取:

rehive.admin.transactions.get(filters={"status":"confirmed"})

创建:

rehive.admin.users.emails.create('1d3e584d-ac56-483c-8aa5-d4ef059608ba','connor+899@rehive.com',verified=True)

修补/放置:

rehive.admin.company.switches.patch('1',enabled=True)# Patch switch with identifier 1

分页:

rehive.admin.currencies.get()rehive.admin.currencies.get_next()rehive.admin.currencies.get_previous()

异常和错误处理

fromrehiveimportAPIExceptiontry:rehive.admin.currencies.get()exceptAPIExceptionase:print(e.status_code)# Error code status code from Rehiveprint(e.data)# Any custom error messages and data returned from Rehive

等幂请求

rehive.user.update(last_name='test7777',idempotent_key='{UNIQUE_KEY}')

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

推荐PyPI第三方库


热门话题
IE中的java跨域cookie问题   重复java中已经满足的循环   编译java RMI服务器时出错   JavaServlet POST中作为参数传递的javascript大型JSON数组数据为空   java片段未每次刷新/调用   java无法编译。错误消息   java如何构造大型类?   java Hibernate:TableThingsDB。事情并不存在   java如何操作从匹配项创建的数组。发现   循环以搜索和显示数组Java的某些部分   加载或注册SQLite JDBC驱动程序时出现java问题   活动和服务之间的java连接   JavaGWTG2D:ie8中的drawImage   java在安卓中设置hessian阈值   在Tomcat中使用Logback时发生java错误