mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
feat: exclude CI downloads from PyPI download count
This commit is contained in:
parent
aad6c63206
commit
0e555699bd
1 changed files with 14 additions and 1 deletions
|
@ -35,11 +35,24 @@ def get_downloads_from_bigquery(credentials_path=None, package_name="aider-chat"
|
|||
# Create a client
|
||||
client = bigquery.Client(credentials=credentials)
|
||||
|
||||
# Query to get total downloads for the package
|
||||
# Query to get total downloads for the package, excluding CI/CD systems
|
||||
query = f"""
|
||||
SELECT COUNT(*) as total_downloads
|
||||
FROM `bigquery-public-data.pypi.file_downloads`
|
||||
WHERE file.project = '{package_name}'
|
||||
AND NOT (
|
||||
-- Exclude common CI/CD systems based on installer name patterns
|
||||
LOWER(details.installer.name) LIKE '%github%' OR
|
||||
LOWER(details.installer.name) LIKE '%travis%' OR
|
||||
LOWER(details.installer.name) LIKE '%circle%' OR
|
||||
LOWER(details.installer.name) LIKE '%jenkins%' OR
|
||||
LOWER(details.installer.name) LIKE '%gitlab%' OR
|
||||
LOWER(details.installer.name) LIKE '%azure%' OR
|
||||
LOWER(details.installer.name) LIKE '%ci%' OR
|
||||
LOWER(details.installer.name) LIKE '%cd%' OR
|
||||
LOWER(details.installer.name) LIKE '%bot%' OR
|
||||
LOWER(details.installer.name) LIKE '%build%'
|
||||
)
|
||||
"""
|
||||
|
||||
# Execute the query
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue