https://github.com/emergingtravel/papi-sdk-python
Official Python SDK for ETG APIv3 (RateHawk.com, ZenHotels.com, B2B.Ostrovok.ru, Ostrovok.ru)
https://github.com/emergingtravel/papi-sdk-python
etg pydantic pypi python python-sdk requests sdk
Last synced: 28 days ago
JSON representation
Official Python SDK for ETG APIv3 (RateHawk.com, ZenHotels.com, B2B.Ostrovok.ru, Ostrovok.ru)
- Host: GitHub
- URL: https://github.com/emergingtravel/papi-sdk-python
- Owner: EmergingTravel
- License: mit
- Created: 2020-12-29T10:02:44.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-25T07:40:13.000Z (over 4 years ago)
- Last Synced: 2025-11-27T09:49:27.123Z (3 months ago)
- Topics: etg, pydantic, pypi, python, python-sdk, requests, sdk
- Language: Python
- Homepage: https://docs.emergingtravel.com/
- Size: 99.6 KB
- Stars: 9
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# pAPI SDK





pAPI SDK is a python SDK for [ETG APIv3](https://docs.emergingtravel.com/).
The abbreviation "pAPI" stands for "Partner API".
To know more about the benefits of our API integration or to sign up please check our [website](https://www.ratehawk.com/lp/en/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](https://github.com/psf/requests), ex. `timeout`.
```python
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:
```python
overview = papi.overview(timeout=1)
```
Another example is downloading hotels dump with `api/b2b/v3/hotel/info/dump` endpoint:
```python
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)`