Skip to main content

Galtea

The Galtea class is the main entry point for the Galtea SDK. It provides access to all the functionalities of the SDK.

Initialization

To initialize the Galtea class, you need to provide your API key obtained in the settings page of the Galtea platform.

Services

The Galtea class provides access to the following services:

Example

Errors

Every call reaches the platform over HTTP, so a failure arrives as a requests exception. When the platform holds nothing under the id or name you passed, the SDK raises EntityNotFoundException. It covers every service: products.get, versions.get_by_name, sessions.get_by_custom_id and the rest all report a missing entity the same way. Import it with from galtea import EntityNotFoundException.
EntityNotFoundException is the name to catch. It covers both ways the SDK learns that nothing matched, so you never have to know which one happened. One lookup can also fail the opposite way. When a version name matches more than one version in the product, versions.get_by_name raises AmbiguousVersionNameException instead of picking one. Import it with from galtea import AmbiguousVersionNameException. The message lists each match, so you can call galtea.versions.get with the ID you want. No other service raises it.
Only a 404 that names an entity becomes EntityNotFoundException. A 404 for a path the API does not serve stays a plain requests.HTTPError, so a typo in a base URL never reads as a missing record. Every other status stays a plain requests.HTTPError too.
Read the status from e.status_code. It is always 404.

When you need the response

The SDK learns that an entity is missing two ways, and raises a different class for each. Both are EntityNotFoundException, so catching that name is enough unless you want the difference. EntityNotFoundHTTPError also derives from requests.HTTPError, so a program that already catches requests.HTTPError around a get() call keeps catching it. Nothing forces you to migrate. The plain EntityNotFoundException is not a requests.HTTPError, because no request failed: the API answered normally and the name was simply not in the result. Reach for response only after catching EntityNotFoundHTTPError, where it is always present.