Skip to main content

Retrieve booking details from GetYourGuide orders

Project description

GygReader

A tool for suppliers on the the GetYourGuide platform to retrieve booking details. Ideal to automize the processing of GetYourGuide bookings.

What it does

Unfortunatly GetYourGuide does not provide webhooks or an API for suppliers to retrieve details from bookings. This can be a problem if GetYourGuide orders need to be processed automatically or registered in your own application/backend.

However an email is sent to the supplier for each booking with the GetYourGuide booking number in the subject. Using services like Zapier or inbound email parsing of Mailgun or SendGrid a webhook can be send to an endpoint retrieving the subject of the GetYourGuide booking email. After parsing the GetYourGuide order number from the subject the GygReader can be used to retrieve the order details and further process the information. For example in Django retrieving the GetYourGuide order number from a SendGrid webhook can look like this:

def endpoint_for_webhook(request):
  subject = request.data["subject"]
  re.search('(GYG)(\d+)',subject).group(0)

How to install and use

To install run:

pip install gyg_reader

Example use:

from gyg_reader import GygReader


gygreader = GygReader("your@email.com", "your_password")
booking = gygreader.get_booking("GYG11111111")

Where GYG11111111 is a GetYourGuide booking number, which can be retrieved like in the example above from the email subject.

booking contains following dictionary:

{'customer_email': 'die@hard.com',
 'customer_name': 'John Mcclane',
 'customer_phone': '+1 202-456-1111',
 'Tour in NYC',
 'amount': '1'}

The full response containing the full booking data can be access following:

gygreader.response.json()

Requirements

  • requests
  • lxml

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

gyg_reader-0.1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

gyg_reader-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file gyg_reader-0.1.1.tar.gz.

File metadata

  • Download URL: gyg_reader-0.1.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for gyg_reader-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ff7e5ffc59f433ee0742d7817a05332aa47934f1fac066434df52914c16e6739
MD5 84ddb0af56418c85795203e553f1c894
BLAKE2b-256 6ba94e30b3fa0939c68e0c7bb2d678bbf58345e3818fa64feb8a8f785df48daf

See more details on using hashes here.

File details

Details for the file gyg_reader-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gyg_reader-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for gyg_reader-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 755fac107c9ad24216f023ad482c08e9a220645017de074b352fa6dff9f23de9
MD5 1964876e40a56263fd5ba35c913d193a
BLAKE2b-256 acaba778bece1b7e749e5494420c97a37db9c9eada9cc4064e4210869ba58266

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