Skip to main content

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.

Metadata

Release files for travelperk-http-python 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for travelperk-http-python 1.2.2
File Size Uploaded Provenance Actions
travelperk-http-python-1.2.2.tar.gz 23.8 kB Without provenance Details for travelperk-http-python-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for travelperk-http-python 1.2.2
File Interpreter ABI Platform Actions
travelperk_http_python-1.2.2-py3-none-any.whl Python 3 none any Details for travelperk_http_python-1.2.2-py3-none-any.whl

Total release size: 77.0 kB

Release files / travelperk-http-python-1.2.2.tar.gz

Download URL travelperk-http-python-1.2.2.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9ab42efd0102bfcf0f3939247c90cb5d70f3695957cda3b3106f09132415ec79
BLAKE2b-256 checksum
How to use checksums
2fac9c277f01150882229f6daf5345da2e4edfd08182b0e1f69e3a330e7061c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / travelperk_http_python-1.2.2-py3-none-any.whl

Download URL travelperk_http_python-1.2.2-py3-none-any.whl
Size 53.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ce33ac7f85d99784655e7f86d82e0fb67711c53b34849b96c3a6d5ffb0726a0
BLAKE2b-256 checksum
How to use checksums
68409100259abc89306b54e92d550b472254396288f11962b1f03d84262eb59b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for travelperk-http-python 1.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page