Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save dstufft/10632316 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 = 'cryptography'
) 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            | 181019
 cpython     | 2.6            |  22626
 cpython     | 3.3            |   1995
 cpython     | 3.4            |    700
 pypy        | 2.2            |    619
 pypy        | 2.0            |    255
 cpython     | 3.2            |    185
 pypy        | 2.1            |      9
 pypy        | 1.8            |      7
 pypy        | 2.3            |      6
(10 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 = 'pyOpenSSL'
) 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            | 274563
 cpython     | 2.6            |  44961
 cpython     | 3.3            |   3423
 pypy        | 2.2            |   1171
 cpython     | 3.4            |    652
 pypy        | 2.0            |    306
 cpython     | 3.2            |    240
 pypy        | 1.8            |     15
 pypy        | 2.1            |     15
 cpython     | 3.5            |      6
 pypy        | 2.3            |      5
 pypy        | 1.9            |      4
(12 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment