/travelperk-cli

Command line tool to access the TravelPerk API data

Primary LanguagePython

travelperk-cli tag build codecov Lint

TravelPerk Cli

Disclaimer

This is in a ver WIP stage and not very usable

About

This is an unofficial command line tool for acessing the TravelPerk official Web API. It is designed so you can query and retrieve all data hold on their platform and accessible through the API form the command line.

Operations included

Expenses

Invoices

  • List all invoices ✔️
  • Retrieve an invoice ✔️
  • Retrieve invoice PDF ✖️
  • List all invoice lines ✔️

Invoice Profiles

  • List all invoice profiles ✔️

SCIM

  • List users ✔️
  • Create a new user ✖️
  • Retrieve a user ✔️
  • Replace a user ✖️
  • Delete a user ✔️

Discovery

  • Service provider configuration ✔️
  • List resource types ✔️
  • List all schemas ✔️
  • User schema details ✔️
  • Enterprise user schema details ✔️

Webhooks

  • List all webhooks ✔️
  • Create a webhook ✔️
  • Retrieve a webhook ✔️
  • Update a webhook ✖️
  • Test a webhook ✔️
  • Delete a webhook ✔️

TravelSafe

  • Get travel restrictions ✔️
  • Get local summary ✔️
  • Get airline safety measures ✔️
  • Get location types ✔️

Cost Centers

  • List cost centers ✔️
  • Creating a cost center ✔️
  • Cost center details ✔️
  • Update a cost center ✖️
  • Bulk update cost centers ✖️
  • Set users to a cost center ✖️

Trips

  • List trips ✔️
  • List bookings ✔️

Users (non SCIM)

  • List users ✔️

Getting started

Before getting started retrieving querying information from the TravelPerk Web API you first need to get an API Key. Then put your API key on the following path: ~/.travelperk/credentials

Retrieving data

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

pipenv run python cli.py scim discovery enterprise-schema

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.