Skip to main content

seatsio-python, the official Seats.io Python SDK

Build PyPI version

This is the official Python SDK for the Seats.io V2 REST API, supporting Python 3.10 or newer.

Installing

pip install seatsio

Or:

uv add seatsio

Versioning

seatsio-python follows semver since v50.2.0.

Usage

General instructions

To use this library, you'll need to create a seatsio.Client:

import seatsio
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-workspace-secret-key")
...

You can find your workspace secret key in the settings section of the workspace.

The region should correspond to the region of your account:

  • seatsio.Region.EU(): Europe
  • seatsio.Region.NA(): North-America
  • seatsio.Region.SA(): South-America
  • seatsio.Region.OC(): Oceania

If you're unsure about your region, have a look at your company settings page.

Creating a chart and an event

import seatsio
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-workspace-secret-key")
chart = client.charts.create()
event = client.events.create(chart.key)

Booking objects

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

Releasing objects

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

Booking objects that have been held

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

Changing object status

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

Retrieving object category and status (and other information)

import seatsio
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-workspace-secret-key")
object_infos = client.events.retrieve_object_infos(event.key, ["A-1", "A-2"])

print(object_infos["A-1"].category_key)
print(object_infos["A-1"].category_label)
print(object_infos["A-1"].status)

print(object_infos["A-2"].category_key)
print(object_infos["A-2"].category_label)
print(object_infos["A-2"].status)

Listing a chart's categories

import seatsio
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-workspace-secret-key")
category_list = client.charts.list_categories(<chart key>)
for category in category_list:
  print(category.label)

Updating a category

import seatsio
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-workspace-secret-key")
client.charts.update_category(chart_key=chart.key, category_key=1, label="Updated label", color="#bbbbbb", accessible=True)

Listing all charts

import seatsio
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-workspace-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)

Creating a workspace

import seatsio
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-company-admin-key")
client.workspaces.create("a workspace")

Creating a chart and an event with the company admin key

import seatsio
# company admin key can be found on https://app.seats.io/company-settings
# workspace public key can be found on https://app.seats.io/workspace-settings
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-company-admin-key", workspace_key="my-workspace-public-key")
chart = client.charts.create()
event = client.events.create(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.

Rate limiting - exponential backoff

This library supports exponential backoff.

When you send too many concurrent requests, the server returns an error 429 - Too Many Requests. The client reacts to this by waiting for a while, and then retrying the request. If the request still fails with an error 429, it waits a little longer, and try again. By default this happens 5 times, before giving up (after approximately 15 seconds).

We throw a RateLimitExceededException (which is a subclass of SeatsioException) when exponential backoff eventually fails.

To change the maximum number of retries, create the Client as follows:

import seatsio
client = seatsio.Client(seatsio.Region.EU(), secret_key="my-workspace-secret-key", max_retries=3)

Passing in 0 disables exponential backoff completely. In that case, the client will never retry a failed request.

Download files

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

Source Distribution

seatsio-83.14.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

seatsio-83.14.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: seatsio-83.14.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for seatsio-83.14.0.tar.gz
Algorithm Hash digest
SHA256 ad573eb7bebeb25a596bdb46b9fe36d10a7f865c5d7db4f796f2fe4272986793
MD5 03a79a58f3e64a5e60ae002da2823738
BLAKE2b-256 bea1372cdc7eac8772d3bff50c24333a435f840ea64ac4623eafefeacbe4b791

See more details on using hashes here.

File details

Details for the file seatsio-83.14.0-py3-none-any.whl.

File metadata

  • Download URL: seatsio-83.14.0-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for seatsio-83.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d80ee3e89a2a93c51dcc146fc2d5e865c51053ab681eceb826dd91e65f71a4c5
MD5 9bdf530f566919a3707205d8e3fb7ca6
BLAKE2b-256 990793b267f8d440fd3d9b9edb6d841028ab6a20da6ccda274cb5666c21e4cf1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

83.14.0 This release

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

42

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