MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / search_repositories

Method search_repositories

github/MainClass.py:671–709  ·  view source on GitHub ↗

:calls: `GET /search/repositories `_ :param query: string :param sort: string ('stars', 'forks', 'updated') :param order: string ('asc', 'desc') :param qualifiers: keyword dict query qualifiers

(
        self,
        query: str,
        sort: Opt[str] = NotSet,
        order: Opt[str] = NotSet,
        **qualifiers: Any,
    )

Source from the content-addressed store, hash-verified

669 )
670
671 def search_repositories(
672 self,
673 query: str,
674 sort: Opt[str] = NotSet,
675 order: Opt[str] = NotSet,
676 **qualifiers: Any,
677 ) -> PaginatedList[RepositorySearchResult]:
678 """
679 :calls: `GET /search/repositories <https://docs.github.com/en/rest/reference/search>`_
680 :param query: string
681 :param sort: string ('stars', 'forks', 'updated')
682 :param order: string ('asc', 'desc')
683 :param qualifiers: keyword dict query qualifiers
684 """
685 assert isinstance(query, str), query
686 url_parameters = dict()
687 if sort is not NotSet: # pragma no branch (Should be covered)
688 assert sort in ("stars", "forks", "updated"), sort
689 url_parameters["sort"] = sort
690 if order is not NotSet: # pragma no branch (Should be covered)
691 assert order in ("asc", "desc"), order
692 url_parameters["order"] = order
693
694 query_chunks = []
695 if query: # pragma no branch (Should be covered)
696 query_chunks.append(query)
697
698 for qualifier, value in qualifiers.items():
699 query_chunks.append(f"{qualifier}:{value}")
700
701 url_parameters["q"] = " ".join(query_chunks)
702 assert url_parameters["q"], "need at least one qualifier"
703
704 return PaginatedList(
705 github.Repository.RepositorySearchResult,
706 self.__requester,
707 "/search/repositories",
708 url_parameters,
709 )
710
711 def search_users(
712 self,

Callers 2

testSearchReposMethod · 0.80

Calls 1

PaginatedListClass · 0.90

Tested by

no test coverage detected