2011-02-09 4 views

Odpowiedz

5

wydaje there isn't, więc napisałem ten (with some help)

#!/usr/bin/env python3 

import xmlrpc.client 

# PyPI classifiers for all Python 3 versions 
PY3 = [ 
    "Programming Language :: Python :: 3", 
    "Programming Language :: Python :: 3.0", 
    "Programming Language :: Python :: 3.1", 
    "Programming Language :: Python :: 3.2", 
    "Programming Language :: Python :: 3.3", 
    "Programming Language :: Python :: 3.4", 
] 

# PyPI classifiers for all Python 2 versions 
PY2 = [ 
    "Programming Language :: Python :: 2", 
    "Programming Language :: Python :: 2.7", 
    "Programming Language :: Python :: 2.6", 
    "Programming Language :: Python :: 2.5", 
    "Programming Language :: Python :: 2.4", 
    "Programming Language :: Python :: 2.3", 
] 

def main(): 
    client = xmlrpc.client.ServerProxy('http://pypi.python.org/pypi') 
    # name[0] is package name 
    # name[1] is package version 
    py3names = [ 
     name[0] for classifier in PY3 for name in client.browse([classifier]) 
    ] 
    py2names = [ 
     name[0] for classifier in PY2 for name in client.browse([classifier]) 
    ] 
    py3only = [name for name in py3names if name not in py2names] 
    template = "Python3-only packages: {} (of {})" 
    print(template.format(len(py3only), len(set(py2names + py3names)))) 

if __name__ == "__main__": 
    main() 
+0

prąd wyjściowy: 'Python3-tylko pakiety: 2823 (z 14595 Aktualizacja: ' – Tshepang

+0

update:' Pakiety tylko dla Python3: 5654 (z 21901) 'aktualizacja – ehremo

+0

:' Pakiety tylko dla Python3: 10217 (z 34610) ' – Will

5

Nie, nie ma takiego indeksu, ale można utwórz jeden z danych klasyfikatora na PyPI.

Można utworzyć listę wszystkich pakietów, które mają "Język programowania :: Python :: 3" lub język programowania :: Python :: 3.0 "lub" Programming Language :: Python 3.1 ", ale żaden z Python 2 . klasyfikatorów

http://pypi.python.org/pypi?:action=browse&c=214

Prawdopodobnie interfejs XML mogą być przydatne:

http://wiki.python.org/moin/PyPiXmlRpc

+0

Oto moja próba http://stackoverflow.com/a/9012768 – Tshepang