Skip to main content

Python SDK for accessing the TravelPerk API

Project description

travelperk-http-python tag build codecov Lint

TravelPerk Python SDK

About

This is an unofficial package for acessing the TravelPerk official Web API from your Python language project. It is designed so you can easily query and retrieve all data hold on their platform and accessible through the API.

Installation

This package is hosted on PyPi, you can install it using any python package manager.

$ pip install travelperk-http-python

Getting started

Before getting started retrieving querying information from the TravelPerk Web API you first need to get an API Key.

Getting a TravelPerk instance

For querying the data you need to get a TravelPerk instance, here are two ways to get a TravelPerk API instance depending on how you authenticate with their API.

At TravelPerk there are two ways to authenticate, using an API Key or OAuth2.

For API Key Authentication

If you have an API Key for authenticating you need to call the Service Provider's build method passing your api key, and a boolean indicating if you will be using the sandbox environment or not like this:

from travelperk_http_python.builder.builder import build
is_sandbox = False
travelperk = build("YOUR_API_KEY", is_sandbox)

For OAuth Authentication

Due to time constrains the OAuth authentication flow is not fully implemented so is not supported yet, see this GitHub issue

Retrieving data

Everything is ready, you can start asking for the data.

travelperk.expenses().invoices().all()

For further information refer to the documentation linked in the next section.

Documentation

The full documentation can be found in the wiki section of this github repository. Also you can refer to the official TravelPerk Web API documentation

License

MIT

Contributing

Any suggestion, bug reports, prs or any other kind enhacements are welcome. Just open an issue first, for creating a PR remember this project has linting checkings and unit tests so any PR should comply with both before beign merged, this checks will be automatically applied when opening or modifying the PRs.

Local development

This project comes with a docker-compose.yml file so if you use Docker and docker-compose you can develop without installing anything on your local environment. Just run docker-compose up --build for the first time to setup the container and launch the tests. Pytest is configured as the entrypoint so just run docker-compose up everytime you want the tests to execute on the Dockerized Python development container.

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

travelperk-http-python-1.1.1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

travelperk_http_python-1.1.1-py3-none-any.whl (54.0 kB view details)

Uploaded Python 3

File details

Details for the file travelperk-http-python-1.1.1.tar.gz.

File metadata

  • Download URL: travelperk-http-python-1.1.1.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for travelperk-http-python-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f67b9011f723c35730cbea289a14205cb68318cebeef8504b65173c8af90e7d1
MD5 fdb9a6ffae370b523079dc5f5cff3c4c
BLAKE2b-256 0be5cb44294e0795372e2b62586a9014e140b9cf0fe85e591223ca63380cde41

See more details on using hashes here.

File details

Details for the file travelperk_http_python-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: travelperk_http_python-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 54.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for travelperk_http_python-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fe045b029d66bf63cec05e2747af8dadae5174b3e12b4d24c6ada434b381aba
MD5 8aa2c120eae12380fadbc558fe78a2e2
BLAKE2b-256 8afb179279060a131a09991d1f597a2669bd2fba8a2b4e256457d6484c4290e8

See more details on using hashes here.

Supported by

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