sabre dev studio rest api的pythonic客户端

scabbard的Python项目详细描述


PyPi versionSupported Python versions

关于

剑鞘是sabre dev studio restapi的pythonic客户端。带鞘的,它 在使用每个api调用之前,不需要创建大量的低级样板代码。 您只需3行代码就可以开始与sabre dev studio api交互。

剑鞘是用来握剑的鞘,如刀-https://en.wikipedia.org/wiki/Scabbard

Princely Mughal sabre with jewelled scabbard

功能

定义的刀鞘休息端点可以在swaggerui中查看:
https://bundgus.github.io/scabbard/SwaggerUI/index.html

开始

(一) 您可以在以下网址注册免费的Sabre Dev Studio帐户:

https://developer.sabre.com/apps/mykeys

(二) 用pip安装鞘库。

$ pip install scabbard

(三) 目录中存在一个名为APIAICONTCONTIONSORDECTRES.JSON的文件。 其中运行python,使用sabre dev studio clientid和clientsecret凭据。

api_connect_parameters.json

{"clientId":"zzzzzzzzzzzzzzzz","clientSecret":"xxxxxxxx","environment":"https://api.test.sabre.com","group":"DEVCENTER","domain":"EXT","formatVersion":"V1"}

(四) 运行代码来练习api。例如:

示例v1listsupportedcountriesset.py

importscabbardclient=scabbard.get_client()countries=client.Air_Utility.V1ListsSupportedCountriesGet(pointofsalecountry='NZ').result()print('PointOfSale')print(countries.PointOfSale)print('OriginCountries')forcincountries.OriginCountries:print(c.CountryCode,c.CountryName)print('DestinationCountries')forcincountries.DestinationCountries:print(c.CountryCode,c.CountryName)print('Links')forlincountries.Links:print(l.rel)print(l.href)

(五) 运行python示例。

$ python example_V1ListsSupportedCountriesGet.py

PointOfSale
NZ
OriginCountries
AU Australia
ID Indonesia
IE Ireland
NZ New Zealand
TH Thailand
GB United Kingdom
DestinationCountries
AU Australia
FR France
DE Germany
HK Hong Kong
IN India
ID Indonesia
IE Ireland
MY Malaysia
NL Netherlands
NZ New Zealand
PH Philippines
SG Singapore
TH Thailand
GB United Kingdom
US United States
Links
self
https://api.test.sabre.com/v1/lists/supported/countries?pointofsalecountry=NZ
linkTemplate
https://api.test.sabre.com/v1/lists/supported/countries?pointofsalecountry=<pointofsalecountry>

安装

$ pip install scabbard

许可证

版权所有(c)2018,Mark Bundgus。保留所有权利。 *没有提供或支持的软件库 *所有引用的军刀内容和服务都是军刀的属性

剑鞘被授权使用BSD 3-Clause License

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

推荐PyPI第三方库


热门话题
javai是JAXB的新手。如何将两个具有不同名称空间的不同xml合并为一个具有根元素的xml并将其解组?   JDO中的java应该是可传递的DefaultFetchGroup吗   java服务器配置问题   java在理解JList时遇到困难   java何时将RequestContextFilter用于Jersey?   java从数据库中读取文本文件。jar文件   Java正则表达式,仅适用于不包括零的正数   爪哇番石榴。类路径中的jar   JavaEE:关于设计的问题   java GUI,在面板中排列按钮   java Android为什么使用接口被认为是活动和片段之间通信的最佳实践?   java如何获取wicket图像的url以在开放图元标记中使用它   从Java字节[]>Base64>Javascript数组缓冲>Base64>byte[]   java正则表达式帮助字符串JWE766。1.pdf格式摘录766   java Hibernate,JPA忽略@Formula