swh.lister.gitlab.lister module

class swh.lister.gitlab.lister.GitLabLister(url=None, instance=None, override_config=None, sort='asc', per_page=20)[source]

Bases: swh.lister.core.page_by_page_lister.PageByPageHttpLister

DEFAULT_URL = 'https://gitlab.com/api/v4/'
MODEL

alias of swh.lister.gitlab.models.GitLabModel

LISTER_NAME = 'gitlab'
PATH_TEMPLATE = '/projects?page=%d&order_by=id'
uid(repo: Dict[str, Any]) → str[source]
get_model_from_repo(repo: Dict[str, Any]) → Dict[str, Any][source]
transport_quota_check(response: requests.models.Response) → Tuple[bool, Union[int, float]][source]

Deal with rate limit if any.

get_next_target_from_response(response: requests.models.Response) → Optional[int][source]

Determine the next page identifier.

get_pages_information() → Tuple[Optional[int], Optional[int], Optional[int]][source]

Determine pages information.

transport_response_simplified(response: requests.models.Response) → List[Dict[str, Any]][source]
Convert the server response into list of a dict for each repo in the

response, mapping columns in the lister’s MODEL class to repo data.

Implementation of this method depends on the server API spec and the shape of the network response object returned by the transport_request method.

Parameters

response – response object from the server.

Returns

list of repo MODEL dicts

( eg. [{‘uid’: r[‘id’], etc.} for r in response.json()] )