Giter VIP home page Giter VIP logo

papi-sdk-python's Introduction

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". To know more about the benefits of our API integration or to sign up please check our website.

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)

papi-sdk-python's People

Contributors

biozz avatar stanislav-losev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

papi-sdk-python's Issues

Add Github Actions

We need to run tests in CI/CD and Github Actions should work just fine.

A couple of things to keep in mind:

  • there is a tox test runner, all of the python version should be respected
  • we need to run tests on different OSes, I would suggest to use an example from circus
  • two main things to do in CI/CD are lint and test

Add mkdocs and publish to Github Pages

The project should have a publicly available documentation. Github Pages should work fine for that.

There are some great examples of how mkdocs works and it is a preferred method of publishing documentation for now.

Add badges to readme

It is nice to have a set of badges at the home page of the repository, we should add those.

We can start with:

  • ci status
  • current pypi version
  • pypi downloads count

Here is an example:

![Build Status](https://github.com/circus-tent/circus/workflows/ci/badge.svg)
![PyPI Version](https://img.shields.io/pypi/v/circus) 
![PyPI Downloads](https://img.shields.io/pypi/dm/circus)

Make more clear name for init payment endpoint

INIT_PARTNERS endpoint is too ambiguous, because it doesn't indicate that it is related to payment. We need a better name, ex. INIT_PAYMENT.

We also need to think about backward compatibility to not break existing integrations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.