Skip to content

Instantly share code, notes, and snippets.

@dstufft
Created April 14, 2014 09:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstufft/10630670 to your computer and use it in GitHub Desktop.
Save dstufft/10630670 to your computer and use it in GitHub Desktop.

Everything is pip 1.4+ all downloads starting 2014-01-02 and ending with 2014-04-13.

SELECT python_type, array_to_string(python_release[0:2], '.') AS python_release, COUNT(*)
FROM (
    SELECT
        python_type,
        string_to_array(
            (
                CASE WHEN (python_release IS NULL OR python_release = '')
                THEN python_version ELSE python_release END
            ),
            '.'
        ) AS python_release
    FROM downloads
    WHERE installer_type = 'pip' AND installer_version != ''
) AS d
GROUP BY python_type, array_to_string(python_release[0:2], '.')
ORDER BY COUNT(*) DESC;

 python_type | python_release |  count
-------------+----------------+----------
 cpython     | 2.7            | 64636587
 cpython     | 2.6            | 16456814
 cpython     | 3.3            |  2795728
 cpython     | 3.2            |   619294
 pypy        | 2.2            |   389259
 cpython     | 3.4            |   321562
 pypy        | 2.0            |    46846
 pypy        | 2.1            |    23336
 pypy        | 1.9            |     5271
 pypy        | 1.8            |     4084
 pypy        | 2.3            |     3453
 jython      | 2.7            |      187
 cpython     | 3.5            |      161
 cpython     | 3.1            |       83
 pypy        | 1.6            |       64
             | Unknown        |       16
 pypy        | 1.7            |        7
 cpython     | 2.7a3          |        4
 cpython     | 2.7rc2         |        4
 cpython     | 2.7rc1         |        3
 cpython     | 3.2rc3         |        1
(21 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment