Skip to main content

Pythonic client for Sabre Dev Studio REST APIs

Project description

PyPi version Supported Python versions

Scabbard

About

Scabbard is a Pythonic client for the Sabre Dev Studio REST APIs. With Scabbard, it is not necessary to create extensive low-level boilerplate code before you can use each API call. You can begin to make real REST calls to the Sabre Dev Studio APIs with only 3 lines of code (including the import).

A scabbard is a sheath for holding a sword, such as a sabre :)

https://en.wikipedia.org/wiki/Scabbard

Sabre Dev Studio REST API documentation:

https://developer.sabre.com/docs/read/rest_apis/

https://developer.sabre.com/io-docs

Scabbard docs: https://bundgus.github.io/scabbard/

GitHub Home: https://github.com/bundgus/scabbard

Example Usage

A file called api_connect_parameters.json must exist in the directory in which python is run, with your Sabre Dev Studio clientID and clientSecret credentials.

You can register for a free Sabre Dev Studio account at the following URL: https://developer.sabre.com/apps/mykeys

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

client = get_client()
countries = client.Air_Utility.V1ListsSupportedCountriesGet(pointofsalecountry='NZ').result()

print('PointOfSale')
print(countries.PointOfSale)

print('OriginCountries')
for c in countries.OriginCountries:
    print(c.CountryCode, c.CountryName)

print('DestinationCountries')
for c in countries.DestinationCountries:
    print(c.CountryCode, c.CountryName)

print('Links')
for l in countries.Links:
    print(l.rel)
    print(l.href)

Installation

$ pip install scabbard

License

Copyright (c) 2018, Mark Bundgus. All rights reserved.

Scabbard is licensed with a BSD 3-Clause License.

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

scabbard-0.1.0.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

scabbard-0.1.0-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page