INNER CODE UNIT · Python
everything_query
simonw/simonw · build_readme.py:143
def everything_query():
"""Search query matching every public repo across the owners."""
return "is:public {} sort:updated".format(OWNERS)
def incremental_query(hours=INCREMENTAL_HOURS):
"""Search query limited to repos pushed within the last `hours` hours."""
since = (datetime.now(timezone.utc) - timedelta(hours=hours)).strftime(
"%Y-%m-%dT%H:%M:%SZ"
)
return "is:public {} pushed:>{} sort:updated".format(OWNERS, since)
def build_search_query(query_string, after_cursor):
return GRAPHQL_SEARCH_QUERY.replace("QUERY_STRING", query_string).replace(
"AFTER", '"{}"'.format(after_cursor) if after_cursor else "null"
)