Changeset View
Changeset View
Standalone View
Standalone View
swh/search/interface.py
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | def origin_search( | ||||
with_visit: bool = False, | with_visit: bool = False, | ||||
visit_types: Optional[List[str]] = None, | visit_types: Optional[List[str]] = None, | ||||
page_token: Optional[str] = None, | page_token: Optional[str] = None, | ||||
min_nb_visits: int = 0, | min_nb_visits: int = 0, | ||||
min_last_visit_date: str = "", | min_last_visit_date: str = "", | ||||
min_last_eventful_visit_date: str = "", | min_last_eventful_visit_date: str = "", | ||||
min_last_revision_date: str = "", | min_last_revision_date: str = "", | ||||
min_last_release_date: str = "", | min_last_release_date: str = "", | ||||
programming_languages: List[str] = [], | |||||
licenses: List[str] = [], | |||||
sort_by: List[str] = [], | sort_by: List[str] = [], | ||||
limit: int = 50, | limit: int = 50, | ||||
) -> PagedResult[MinimalOriginDict]: | ) -> PagedResult[MinimalOriginDict]: | ||||
"""Searches for origins matching the `url_pattern`. | """Searches for origins matching the `url_pattern`. | ||||
Args: | Args: | ||||
url_pattern: Part of the URL to search for | url_pattern: Part of the URL to search for | ||||
with_visit: Whether origins with no visit are to be | with_visit: Whether origins with no visit are to be | ||||
filtered out | filtered out | ||||
visit_types: Only origins having any of the provided visit types | visit_types: Only origins having any of the provided visit types | ||||
(e.g. git, svn, pypi) will be returned | (e.g. git, svn, pypi) will be returned | ||||
page_token: Opaque value used for pagination | page_token: Opaque value used for pagination | ||||
min_nb_visits: Filter origins that have number of visits >= | min_nb_visits: Filter origins that have number of visits >= | ||||
the provided value | the provided value | ||||
min_last_visit_date: Filter origins that have | min_last_visit_date: Filter origins that have | ||||
last_visit_date on or after the provided date(ISO format) | last_visit_date on or after the provided date(ISO format) | ||||
min_last_eventful_visit_date: Filter origins that have | min_last_eventful_visit_date: Filter origins that have | ||||
last_eventful_visit_date (eventful = snapshot_id changed) | last_eventful_visit_date (eventful = snapshot_id changed) | ||||
on or after the provided date(ISO format) | on or after the provided date(ISO format) | ||||
min_last_revision_date: Filter origins that have | min_last_revision_date: Filter origins that have | ||||
last_revision_date on or after the provided date(ISO format) | last_revision_date on or after the provided date(ISO format) | ||||
min_last_release_date: Filter origins that have | min_last_release_date: Filter origins that have | ||||
last_release_date on or after the provided date(ISO format) | last_release_date on or after the provided date(ISO format) | ||||
licenses: Filter origins with licenses present in the given list | |||||
(based on instrinsic_metadata) | |||||
programming_languages: Filter origins with programming languages | |||||
present in the given list (based on instrinsic_metadata) | |||||
sort_by: Sort results based on a list of fields mentioned in SORT_BY_OPTIONS | sort_by: Sort results based on a list of fields mentioned in SORT_BY_OPTIONS | ||||
(nb_visits,last_visit_date, last_eventful_visit_date, | (nb_visits,last_visit_date, last_eventful_visit_date, | ||||
last_revision_date, last_release_date). | last_revision_date, last_release_date). | ||||
Return results in descending order if "-" is present at the beginning | Return results in descending order if "-" is present at the beginning | ||||
otherwise in ascending order. | otherwise in ascending order. | ||||
limit: number of results to return | limit: number of results to return | ||||
Returns: | Returns: | ||||
PagedResult of origin dicts matching the search criteria. If next_page_token | PagedResult of origin dicts matching the search criteria. If next_page_token | ||||
is None, there is no longer data to retrieve. | is None, there is no longer data to retrieve. | ||||
""" | """ | ||||
... | ... |