Skip to main content

pAPI SDK is a Python SDK for ETG APIv3

Project description

pAPI SDK

main workflow pypi version pypi downloads python versions license

pAPI SDK is a python SDK for ETG APIv3. The abbreviation "pAPI" stands for "Partner API".

Requirements

  • Python 3.6+
  • requests
  • pydantic

Installation

pip install papi-sdk

Quickstart

To start using ETG APIv3 you need a key, which you received after registration. A key is a combination of an id and uuid. These are passed into each request as a Basic Auth header after initialization. APIv3 supports all arguments provided by requests, ex. timeout.

from papi_sdk import APIv3


papi = APIv3(key='1000:022a2cf1-d279-02f3-9c3c-596aa09b827b', timeout=15)

Then you can use all available methods. Say you want to check an overview of the available methods (which is api/b2b/v3/overview endpoint), you do:

overview = papi.overview(timeout=1)

Another example is downloading hotels dump with api/b2b/v3/hotel/info/dump endpoint:

data = HotelInfoDumpRequest(language='ru')
dump = papi.get_hotel_info_dump(data=data)
print(dump.data.url)

Note: if you don't provide your headers and specifically your User-Agent in requests options then it will be automatically added, ex. papi-sdk/v1.0.2 requests/2.25.1 (python/3.8)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for papi-sdk, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size papi_sdk-1.1.1-py3-none-any.whl (61.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size papi-sdk-1.1.1.tar.gz (41.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page