mirror of
https://github.com/vinta/awesome-python.git
synced 2026-10-02 08:23:10 +08:00
refactor: reformat clickpy query string with ruff format
ruff format --check flagged this file for the multi-line f-string concatenation. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -84,12 +84,7 @@ def collect_names(readme_text: str) -> list[str]:
|
|||||||
|
|
||||||
def fetch_clickpy(names: list[str]) -> dict[str, int]:
|
def fetch_clickpy(names: list[str]) -> dict[str, int]:
|
||||||
in_list = ", ".join(f"'{name}'" for name in names)
|
in_list = ", ".join(f"'{name}'" for name in names)
|
||||||
query = (
|
query = f"SELECT project, sum(count) AS downloads FROM pypi.pypi_downloads_per_day WHERE project IN ({in_list}) AND date >= today() - 30 GROUP BY project FORMAT JSON"
|
||||||
"SELECT project, sum(count) AS downloads "
|
|
||||||
"FROM pypi.pypi_downloads_per_day "
|
|
||||||
f"WHERE project IN ({in_list}) AND date >= today() - 30 "
|
|
||||||
"GROUP BY project FORMAT JSON"
|
|
||||||
)
|
|
||||||
resp = httpx.post(CLICKPY_URL, content=query, timeout=60)
|
resp = httpx.post(CLICKPY_URL, content=query, timeout=60)
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
return {row["project"]: int(row["downloads"]) for row in resp.json()["data"]}
|
return {row["project"]: int(row["downloads"]) for row in resp.json()["data"]}
|
||||||
|
|||||||
Reference in New Issue
Block a user