Skip to main content

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

Build Status

This is the official Python client library for the Seats.io V2 REST API, supporting python 2.7, and python 3.3 - 3.7.

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

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

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

Releasing objects

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

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

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

import seatsio
client = seatsio.Client(secret_key="my-secret-key")
charts = client.charts.list()
for chart in charts:
  print("Chart: " + chart.key)

Note: list() returns a PagedIterator, which under the hood calls the seats.io API to fetch charts page by page. So multiple API calls may be done underneath to fetch all charts.

Listing charts page by page

E.g. to show charts in a paginated list on a dashboard.

Each page contains an items array of charts, and next_page_starts_after and previous_page_ends_before properties. Those properties are the chart IDs after which the next page starts or the previous page ends.

# ... user initially opens the screen ...

firstPage = client.charts.list_first_page()
for chart in firstPage.items:
  print("Chart: " + chart.key)
# ... user clicks on 'next page' button ...

nextPage = client.charts.list_page_after(firstPage.next_page_starts_after)
for chart in nextPage.items:
  print("Chart: " + chart.key)
# ... user clicks on 'previous page' button ...

previousPage = client.charts.list_page_before(nextPage.previous_page_ends_before)
for chart in previousPage.items:
  print("Chart: " + chart.key)

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:

  • Errors: a list of errors (containing a code and a message) 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.

Download files

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

Source Distribution

seatsio-42.tar.gz (12.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: seatsio-42.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3

File hashes

Hashes for seatsio-42.tar.gz
Algorithm Hash digest
SHA256 af3824fdcaedfe5f0bb75482f62578be0dc9104c467208d23909efffd23d079e
MD5 8d62a6775db7298667acc1c5caf6d8e8
BLAKE2b-256 a4be942dee4c800d020098841d27160185f291e495259bf628eb3bd2f63205c5

See more details on using hashes here.

Release history Release notifications | RSS feed

83.14.0

2 files

83.13.0

2 files

83.12.0

2 files

83.11.0

2 files

83.10.0

2 files

83.9.0

2 files

83.8.0

2 files

83.7.0

2 files

83.6.0

2 files

83.5.0

2 files

83.4.0

2 files

83.3.0

1 file

83.2.0

1 file

83.1.0

1 file

83.0.0

1 file

82.0.0

1 file

81.13.0

1 file

81.12.0

1 file

81.11.0

1 file

81.10.0

1 file

81.9.0

1 file

81.8.0

1 file

81.7.0

1 file

81.6.0

1 file

81.5.0

1 file

81.4.0

1 file

81.3.0

1 file

81.2.0

1 file

81.1.0

1 file

81.0.0

1 file

80.2.0

1 file

80.1.0

1 file

80.0.0

1 file

79.0.0

1 file

78.1.0

1 file

78.0.0

1 file

77.0.0

1 file

76.13.0

1 file

76.12.0

1 file

76.11.0

1 file

76.10.0

1 file

76.9.0

1 file

76.8.0

1 file

76.7.0

1 file

76.6.0

1 file

76.5.0

1 file

76.4.0

1 file

76.3.0

1 file

76.2.0

1 file

76.1.0

1 file

76.0.0

1 file

75.3.0

1 file

75.2.0

1 file

75.1.0

1 file

75.0.0

1 file

74.2.0

1 file

74.1.0

1 file

74.0.0

1 file

73.1.0

1 file

73.0.0

1 file

72.4.0

1 file

72.3.0

1 file

72.1.0

1 file

71.6.0

1 file

71.5.0

1 file

71.4.0

1 file

71.3.0

1 file

71.2.0

1 file

71.1.0

1 file

71.0.0

1 file

70.0.0

1 file

69.1.0

1 file

69.0.0

1 file

68.0.0

1 file

67.0.0

1 file

66.1.0

1 file

66.0.0

1 file

65.3.0

1 file

65.2.0

1 file

65.1.0

1 file

65.0.0

1 file

64.3.0

1 file

64.2.0

1 file

64.1.0

1 file

64.0.0

1 file

62.1.0

1 file

62.0.0

1 file

61.1.0

1 file

61.0.0

1 file

60.4.0

1 file

58.2.0

1 file

58.1.0

1 file

58.0.0

1 file

57.0.0

1 file

56.2.0

1 file

56.0.0

1 file

55.0.0

1 file

54.0.0

1 file

53.0.0

1 file

52.1.0

1 file

52.0.0

1 file

51.10.0

1 file

51.9.0

1 file

51.8.0

1 file

51.7.0

1 file

51.6.0

1 file

51.5.0

1 file

51.3.0

1 file

51.2.0

1 file

51.1.0

1 file

51.0.0

1 file

50.3.0

1 file

50.2.0

1 file

50.1

1 file

50

1 file

49

1 file

48

1 file

47

1 file

46

1 file

45

1 file

44

1 file

43

1 file

This release

42 This release

1 file

40

1 file

39

1 file

38

1 file

37

1 file

36

1 file

35

1 file

34

1 file

33

1 file

32

1 file

31

1 file

30

1 file

29

1 file

28

1 file

27

1 file

26

1 file

25

1 file

22

1 file

21

1 file

20

1 file

19

1 file

2

1 file

1

1 file

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