Architectural overview of the SatelliteVu SDK for Python.
The SatelliteVu SDK for Python is composed of lightweight modules providing configurable classes. Each class provides sensible defaults to get easily started while allowing custom configurations and implementations to build specific environments.
As an SDK for REST APIs, providing an HTTP client is essential. A client class requiring
only the urllib package in the Python Standard Library is provided in
satellitevu.http.urllib.UrllibClient. This is the
default client class used when no other is specified.
All clients wrap their responses in an instance of
satellitevu.http.base.ResponseWrapper with the original
response available in the raw property.
When httpx or requests is installed, alternative HTTP client classes from
satellitevu.http.httpx.HttpxClient or
satellitevu.http.requests.RequestsSession can be used.
The workflow of getting an access token from the OIDC API is managed in the
satellitevu.Auth class, which offers a token() method to
allow the the requested scopes to be represented within the returned access token.
See examples/auth.py for an example of how to use it.
To avoid hitting token request rate limits, the Auth class utilizes a cache - by default an instance of satellitevu.auth.AppDirCache is used. Any class implementing the satellitevu.auth.cache.AbstractCache can be passed to the Auth class constructor instead, if you wish so.
The AppDirCache cache uses a simple file based cache in the cache dir of the current user. This is the reason for our only required dependency, appdirs.
Classes for each available API are maintained in satellitevu.apis, i.e. for the Catalog API and Orders API. They use the satellitevu.apis.base.AbstractApi base class for building URLs, sending requests and raising exceptions.
Using all of the above, the main client satellitevu.Client, provides the central entry point to interacting with our platform APIs.
See examples/catalog.py for an example of how to use it.