# travelperk-http-python [![tag](https://img.shields.io/github/tag/namelivia/travelperk-http-python.svg)](https://github.com/namelivia/travelperk-http-python/releases) [![build](https://github.com/namelivia/travelperk-http-python/actions/workflows/build.yml/badge.svg)](https://github.com/namelivia/travelperk-http-python/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/namelivia/travelperk-http-python/branch/main/graph/badge.svg?token=ncBKtvoHR5)](https://codecov.io/gh/namelivia/travelperk-http-python) [![Lint](https://github.com/namelivia/travelperk-http-python/actions/workflows/black.yml/badge.svg)](https://github.com/namelivia/travelperk-http-python/actions/workflows/black.yml)
<p align="center">
<img src="https://user-images.githubusercontent.com/1571416/118358121-b78de000-b57d-11eb-9987-f750ed530d83.png" alt="TravelPerk Python SDK" />
</p>
## About
This is an unofficial package for acessing the [TravelPerk official Web API](https://developers.travelperk.com) 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](https://pypi.org/project/travelperk-http-python), you can install it using any python package manager.
```bash
$ 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](https://developers.travelperk.com/reference#authentication).
### 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](https://developers.travelperk.com/reference#authentication), using an API Key or OAuth2.
#### For API Key Authentication
If you have an [API Key](https://developers.travelperk.com/reference#api-keys-1) 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](https://developers.travelperk.com/docs/postman-collection#step-2---configure-the-postman-environment) or not like this:
```python
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](https://github.com/namelivia/travelperk-http-python/issues/10)
### Retrieving data
Everything is ready, you can start asking for the data.
```python
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](https://github.com/namelivia/travelperk-http-python/wiki).
Also you can refer to the [official TravelPerk Web API documentation](https://developers.travelperk.com/reference)
## License
[MIT](LICENSE)
## Contributing
Any suggestion, bug reports, prs or any other kind enhacements are welcome. Just [open an issue first](https://github.com/namelivia/travelperk-http-python/issues/new), 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/namelivia/travelperk-http-python",
"name": "travelperk-http-python",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8, <4",
"maintainer_email": "",
"keywords": "travelperk,api",
"author": "Jos\u00e9 Ignacio Amelivia Santiago",
"author_email": "jignacio.amelivia@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/2f/ac/9c277f01150882229f6daf5345da2e4edfd08182b0e1f69e3a330e7061c1/travelperk-http-python-1.2.2.tar.gz",
"platform": null,
"description": "# travelperk-http-python [![tag](https://img.shields.io/github/tag/namelivia/travelperk-http-python.svg)](https://github.com/namelivia/travelperk-http-python/releases) [![build](https://github.com/namelivia/travelperk-http-python/actions/workflows/build.yml/badge.svg)](https://github.com/namelivia/travelperk-http-python/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/namelivia/travelperk-http-python/branch/main/graph/badge.svg?token=ncBKtvoHR5)](https://codecov.io/gh/namelivia/travelperk-http-python) [![Lint](https://github.com/namelivia/travelperk-http-python/actions/workflows/black.yml/badge.svg)](https://github.com/namelivia/travelperk-http-python/actions/workflows/black.yml)\n\n<p align=\"center\">\n <img src=\"https://user-images.githubusercontent.com/1571416/118358121-b78de000-b57d-11eb-9987-f750ed530d83.png\" alt=\"TravelPerk Python SDK\" />\n</p>\n\n## About\n\nThis is an unofficial package for acessing the [TravelPerk official Web API](https://developers.travelperk.com) 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.\n\n## Installation\n\nThis package is hosted on [PyPi](https://pypi.org/project/travelperk-http-python), you can install it using any python package manager. \n\n```bash\n$ pip install travelperk-http-python\n```\n\n## Getting started\n\nBefore getting started retrieving querying information from the TravelPerk Web API you first need to [get an API Key](https://developers.travelperk.com/reference#authentication).\n\n### Getting a TravelPerk instance\n\nFor 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.\n\nAt TravelPerk there are [two ways to authenticate](https://developers.travelperk.com/reference#authentication), using an API Key or OAuth2.\n\n#### For API Key Authentication\n\nIf you have an [API Key](https://developers.travelperk.com/reference#api-keys-1) 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](https://developers.travelperk.com/docs/postman-collection#step-2---configure-the-postman-environment) or not like this:\n\n```python\nfrom travelperk_http_python.builder.builder import build\nis_sandbox = False\ntravelperk = build(\"YOUR_API_KEY\", is_sandbox)\n```\n\n#### For OAuth Authentication\n\nDue to time constrains the OAuth authentication flow is not fully implemented so is not supported yet, see [this GitHub issue](https://github.com/namelivia/travelperk-http-python/issues/10)\n\n### Retrieving data\n\nEverything is ready, you can start asking for the data.\n```python\ntravelperk.expenses().invoices().all()\n```\nFor further information refer to the documentation linked in the next section.\n\n## Documentation\n\nThe full documentation can be found [in the wiki section of this github repository](https://github.com/namelivia/travelperk-http-python/wiki).\nAlso you can refer to the [official TravelPerk Web API documentation](https://developers.travelperk.com/reference)\n\n## License\n\n[MIT](LICENSE)\n\n## Contributing\nAny suggestion, bug reports, prs or any other kind enhacements are welcome. Just [open an issue first](https://github.com/namelivia/travelperk-http-python/issues/new), 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.\n\n## Local development\n\nThis 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.\n",
"bugtrack_url": null,
"license": "",
"summary": "Python SDK for accessing the TravelPerk API",
"version": "1.2.2",
"split_keywords": [
"travelperk",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "e740104dde46e8fa7b7cfcd339fb5244",
"sha256": "9ce33ac7f85d99784655e7f86d82e0fb67711c53b34849b96c3a6d5ffb0726a0"
},
"downloads": -1,
"filename": "travelperk_http_python-1.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e740104dde46e8fa7b7cfcd339fb5244",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8, <4",
"size": 53161,
"upload_time": "2022-12-26T18:57:18",
"upload_time_iso_8601": "2022-12-26T18:57:18.745376Z",
"url": "https://files.pythonhosted.org/packages/68/40/9100259abc89306b54e92d550b472254396288f11962b1f03d84262eb59b/travelperk_http_python-1.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "0d45050454ba056f880e53d2394c4d01",
"sha256": "9ab42efd0102bfcf0f3939247c90cb5d70f3695957cda3b3106f09132415ec79"
},
"downloads": -1,
"filename": "travelperk-http-python-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "0d45050454ba056f880e53d2394c4d01",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8, <4",
"size": 23817,
"upload_time": "2022-12-26T18:57:19",
"upload_time_iso_8601": "2022-12-26T18:57:19.878549Z",
"url": "https://files.pythonhosted.org/packages/2f/ac/9c277f01150882229f6daf5345da2e4edfd08182b0e1f69e3a330e7061c1/travelperk-http-python-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-26 18:57:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "namelivia",
"github_project": "travelperk-http-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "travelperk-http-python"
}