Skip to content

Instantly share code, notes, and snippets.

@dstufft
Created April 14, 2014 09:44
Show Gist options
  • Select an option

  • Save dstufft/10632954 to your computer and use it in GitHub Desktop.

Select an option

Save dstufft/10632954 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 != '' AND package_name = 'pip'
) 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            | 799159
 cpython     | 2.6            | 160850
 cpython     | 3.3            |  61823
 cpython     | 3.2            |  13261
 cpython     | 3.4            |   2042
 pypy        | 1.9            |   1987
 pypy        | 2.2            |   1850
 pypy        | 2.0            |    399
 pypy        | 1.8            |    260
 pypy        | 2.1            |     98
 pypy        | 2.3            |     82
 pypy        | 1.6            |     30
 cpython     | 3.1            |      3
 cpython     | 3.5            |      2
 cpython     | 2.7rc1         |      2
 cpython     | 2.7a3          |      1
(16 rows)
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 != '' AND package_name = 'virtualenv'
) 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            | 612002
 cpython     | 2.6            |  71342
 cpython     | 3.3            |  32882
 cpython     | 3.2            |  10036
 pypy        | 2.2            |   7762
 cpython     | 3.4            |   5623
 pypy        | 2.1            |     89
 pypy        | 2.0            |     54
 pypy        | 2.3            |     15
 pypy        | 1.8            |     13
 pypy        | 1.9            |     11
 cpython     | 3.5            |      3
 cpython     | 3.1            |      3
 jython      | 2.7            |      2
(14 rows)
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 != '' AND package_name = 'setuptools'
) 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            | 1493976
 cpython     | 2.6            |  248718
 cpython     | 3.3            |   56187
 cpython     | 3.2            |   16599
 cpython     | 3.4            |    5854
 pypy        | 2.0            |    5146
 pypy        | 2.2            |    1526
 pypy        | 2.3            |     307
 pypy        | 2.1            |     144
 pypy        | 1.8            |      85
 pypy        | 1.9            |      30
 cpython     | 3.5            |      12
 pypy        | 1.6            |       3
 cpython     | 2.7a3          |       1
 cpython     | 2.7rc1         |       1
             | Unknown        |       1
 cpython     | 3.1            |       1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment