Skip to main content

ServiceAPI, a base class for APIs which talk to a service, typically a web service via HTTP.

Project description

ServiceAPI, a base class for APIs which talk to a service, typically a web service via HTTP.

Latest release 20230703: Retry logic for requests.

An instance of a ServiceAPI embodies some basic features that feel common to web based services:

  • a notion of a login
  • local state, an SQLTags for data about entities of the service
  • downloads, if that is a thing, with FSTags for file annotations

Class HTTPServiceAPI(ServiceAPI, cs.resources.MultiOpenMixin, cs.context.ContextManagerMixin)

HTTPServiceAPI base class for other APIs talking to HTTP services.

Subclasses must define:

  • API_BASE: the base URL of API calls. For example, the PlayOnAPI defines this as f'https://{API_HOSTNAME}/v3/'.

Class RequestsNoAuth(requests.auth.AuthBase)

This is a special purpose subclass of requests.auth.AuthBase to apply no authorisation at all. This is for services with their own special purpose authorisation and avoids things like automatic netrc based auth.

Class ServiceAPI(cs.resources.MultiOpenMixin, cs.context.ContextManagerMixin)

SewrviceAPI base class for other APIs talking to services.

Release Log

Release 20230703: Retry logic for requests.

Release 20230217: Initial release.

Project details


Download files

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

Source Distribution

cs.service_api-20230703.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

cs.service_api-20230703-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page