codingame_tools.client.service.services.search¶
search
¶
Async Search service endpoint.
CgSearchServiceHelper
¶
CgSearchServiceHelper(service)
Bases: CgServiceHelper['CgSearchService']
Helper methods for CgSearchService. Currently empty.
Source code in codingame_tools/client/service/cg_service.py
124 125 | |
CgSearchService
¶
CgSearchService(client)
Bases: CgService
Async Search service endpoint.
Source code in codingame_tools/client/service/services/search.py
25 26 27 | |
search
async
¶
search(query, locale='en', type_filter=None)
Search for codingamers, puzzles, and other objects by name.
Parameters:
-
query(str) –The search query text, e.g. a codingamer's pseudo or part of a puzzle title.
-
locale(str, default:'en') –Locale code for localized result names, e.g. "en", "fr". Defaults to "en".
-
type_filter(CgSearchResultType | None, default:None) –If provided, restricts results to a single
CgSearchResultType(e.g. "USER", "PUZZLE"). Passing a list/tuple of types instead of a single string is rejected by the server with a 422 INVALID_PARAMETERS error. If not provided, results of all types are returned.
Returns:
-
list[CgSearchResult]–A list of CgSearchResult objects.
Raises:
-
CgAuthenticationError–If the session is not authenticated and cannot implicitly login.
-
CgClientHttpError–If a transport error occurs, if the response content could not be decoded at all, if the status code is not 2xx, or if the decoded content is not a list.
Source code in codingame_tools/client/service/services/search.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |