Skip to main content

The official Seats.io Python client library

Project description

# seatsio-python, the official Seats.io Python client library

[![Build Status](https://travis-ci.org/seatsio/seatsio-python.svg?branch=master)](https://travis-ci.org/seatsio/seatsio-python)

This is the official Python client library for the [Seats.io V2 REST API](https://www.seats.io/docs/api-v2), supporting python 2.7, and python 3.3 - 3.6.

## Installing

` pip install seatsio `

## Versioning

seatsio-python only uses major version numbers: v5, v6, v7 etc. Each release - backwards compatible or not - receives a new major version number.

The reason: we want to play safe and assume that each release _might_ break backwards compatibility.

## Examples

### Creating a chart and an event

`python import seatsio client = seatsio.Client(secret_key="my-secret-key") # can be found on https://app.seats.io/settings chart = client.charts.create() event = client.events.create(chart.key) `

### Booking objects

`python import seatsio client = seatsio.Client(secret_key="my-secret-key") client.events.book(event.key, ["A-1", "A-2"]) `

### Releasing objects

`python import seatsio client = seatsio.Client(secret_key="my-secret-key") client.events.release(event.key, ["A-1", "A-2"]) `

### Booking objects that have been held

`python import seatsio client = seatsio.Client(secret_key="my-secret-key") client.events.book(event.key, ["A-1", "A-2"], hold_token="a-hold-token") `

### Changing object status

`python import seatsio client = seatsio.Client(secret_key="my-secret-key") client.events.change_object_status("<EVENT KEY>", ["A-1", "A-2"], "my-custom-status") `

### Listing all charts

`python import seatsio client = seatsio.Client(secret_key="my-secret-key") charts = client.charts.list() # returns a PagedIterator object `

### Listing the first page of charts (default page size is 20)

`python import seatsio client = seatsio.Client(secret_key="my-secret-key") charts = client.charts.list_first_page() # returns a Page object `

## Error handling

When an API call results in a 4xx or 5xx error (e.g. when a chart could not be found), a SeatsioException is raised.

This exception contains a message string describing what went wrong, and also two other properties:

  • Messages: a list of error messages that the server returned. In most cases, this list will contain only one element.

  • RequestId: the identifier of the request you made. Please mention this to us when you have questions, as it will make debugging easier.

Project details


Release history Release notifications | RSS feed

This version

1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seatsio-1.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file seatsio-1.tar.gz.

File metadata

  • Download URL: seatsio-1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for seatsio-1.tar.gz
Algorithm Hash digest
SHA256 6448b21f34cface2d7269b93116133b8a1aaa6a910e48c596746099597d5b88a
MD5 2fd2823bb6c6b1eef5309a3281a8015f
BLAKE2b-256 bb89fbfede455ef254501493f9373d149a33dc66a2c2f1e30e1b7fac3e9ddd06

See more details on using hashes here.

Supported by

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