Created
          July 21, 2016 02:59 
        
      - 
      
- 
        Save kmmbvnr/668eaa7ce6eb71234ef2954a871326a2 to your computer and use it in GitHub Desktop. 
    Query pypi package download stats
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | SELECT details.installer.name, COUNT(*) | |
| FROM | |
| TABLE_DATE_RANGE( | |
| [the-psf:pypi.downloads], | |
| TIMESTAMP("20160601"), | |
| TIMESTAMP("20160630") | |
| ) | |
| WHERE file.project='django-material' | |
| group by details.installer.name | 
SELECT count(*), country_code, file.filename, details.installer.version, details.python,
         details.distro.name, details.distro.version, details.distro.id, details.distro.libc.version,
         details.system.release, details.cpu, details.openssl_version, tls_protocol, tls_cipher
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    TIMESTAMP("20170101"),
    TIMESTAMP("20170531")
  )
WHERE file.project='django-fsm'
and details.installer.name='pip'
group by country_code, file.filename, details.installer.version, details.python,
         details.distro.name, details.distro.version, details.distro.id, details.distro.libc.version,
         details.system.release, details.cpu, details.openssl_version, tls_protocol, tls_cipher
order by 1 descSELECT file.project, COUNT(*)
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    TIMESTAMP("20170101"),
    TIMESTAMP("20170619")
  )
WHERE file.project like 'django%'
  and details.installer.name = 'pip'
group by file.project
order by 2 descSELECT DATE(timestamp), COUNT(*)
FROM
  TABLE_DATE_RANGE(
    [the-psf:pypi.downloads],
    TIMESTAMP("20170101"),
    TIMESTAMP("20170621")
  )
WHERE file.project='django-material'
  and details.installer.name=='pip'
group by 1
order by 1
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
https://bigquery.cloud.google.com/dataset/the-psf:pypi
More gists - https://gist.github.com/alex/4f100a9592b05e9b4d63