CxClient

class wwt_api_client.constellations.CxClient(config: ClientConfig | None = None, oidcc_cache_identifier: str | None = 'wwt_api_client')[source]

Bases: object

A client for the WWT Constellations APIs.

This client authenticates automatically using OpenID Connect protocols. API calls may cause it to print a URL to the terminal, requesting that the user visit it to navigate a login flow.

Parameters:
configoptional ClientConfig

If specified, the client configuration to use. Defaults to calling ClientConfig.new_default().

oidcc_cache_identifier: optional :class:`str`

The identifier to use for caching this client’s state in the openidc_client cache. Defaults to "wwt_api_client". You are unlikely to need to change this setting.

Methods Summary

find_images_by_wwt_url(wwt_url)

Find images in the database associated with a particular "legacy" WWT data URL.

get_builtin_backgrounds()

Get the list of builtin background imagery options.

get_home_timeline(page_num)

Get information about a group of scenes on the home timeline.

handle_client(handle)

Return a client class for making API calls specific to the given handle.

image_client(id)

Return a client class for making API calls specific to the given image.

scene_client(id)

Return a client class for making API calls specific to the given scene.

Methods Documentation

find_images_by_wwt_url(wwt_url: str) List[ImageSummary][source]

Find images in the database associated with a particular “legacy” WWT data URL.

This method corresponds to the POST /images/find-by-legacy-url API endpoint.

get_builtin_backgrounds() List[ImageSummary][source]

Get the list of builtin background imagery options.

This method corresponds to the GET /images/builtin-backgrounds API endpoint.

get_home_timeline(page_num: int) List[SceneHydrated][source]

Get information about a group of scenes on the home timeline.

Parameters:
page_numint

Which page to retrieve. Page zero gives the top items on the timeline, page one gives the next set, etc.

Returns:
A list of SceneHydrated
items.

Notes

The page size is not specified externally, nor is it guaranteed to be stable from one page to the next. If you care, look at the length of the list that you get back from an API.

handle_client(handle: str) HandleClient[source]

Return a client class for making API calls specific to the given handle.

Parameters:
handlestr

The handle of interest.

Returns:
handles.HandleClient
image_client(id: str) ImageClient[source]

Return a client class for making API calls specific to the given image.

Parameters:
idstr

The ID of the image of interest.

Returns:
images.ImageClient
scene_client(id: str) SceneClient[source]

Return a client class for making API calls specific to the given scene.

Parameters:
idstr

The ID of the scene of interest.

Returns:
scenes.SceneClient