Skip to content

Commit

Permalink
string matching against top 1000 packages this month
Browse files Browse the repository at this point in the history
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
  • Loading branch information
kennethreitz committed Sep 21, 2017
1 parent a65a9da commit aeaabf4
Show file tree
Hide file tree
Showing 5 changed files with 7,527 additions and 40 deletions.
267 changes: 227 additions & 40 deletions pipenv/utils.py
Expand Up @@ -35,51 +35,238 @@
# print(collected)

packages = [
'simplejson', 'setuptools', 'six', 'requests', 'pip', 'python-dateutil',
'virtualenv', 'boto', 'pyasn1', 'pbr', 'docutils', 'distribute', 'pytz',
'certifi', 'botocore', 'rsa', 'PyYAML', 'jmespath', 'awscli', 'colorama',
'Jinja2', 'wincertstore', 'nose', 'MarkupSafe', 'lxml', 'cffi', 'selenium',
'paramiko', 'pycrypto', 'argparse', 'pycparser', 'coverage', 'Django', 'ecdsa',
'mock', 'psycopg2', 'pika', 'wheel', 'httplib2', 'pep8', 'Pygments', 'enum34',
'redis', 'SQLAlchemy', 'futures', 'Werkzeug', 'psutil', 'pymongo', 'cryptography',
'Pillow', 'Flask', 'supervisor', 'greenlet', 'pyOpenSSL', 'Babel', 'bcdoc', 'numpy',
'py', 'meld3', 'MySQL-python', 'ipaddress', 'kombu', 'docopt', 'zc.buildout',
'urllib3', 'Paste', 'pyparsing', 'pyflakes', 'Sphinx', 'tornado', 'carbon',
'jsonschema', 'zope.interface', 'anyjson', 'itsdangerous', 'decorator',
'beautifulsoup4', 'idna', 'PasteDeploy', 'Mako', 'ssl', 'flake8', 'mccabe',
'amqp', 'graphite-web', 'unittest2', 'pytest', 'ordereddict', 'stevedore',
'celery', 'backports.ssl_match_hostname', 'gunicorn', 'Fabric', 'ipython',
'awscli-cwlogs', 'iso8601', 'gevent', 'setuptools-git', 'PrettyTable',
'netaddr', 'WebOb', 'billiard', 'msgpack-python', 'setuptools_scm',
'pylint', 'Twisted', 'blessings', 'vcversioner', 'oslo.config',
'oauth2client', 'pyasn1-modules', 'ujson', 'funcsigs', 'logilab-common',
'South', 'oauthlib', 's3transfer', 'html5lib', 'google-api-python-client',
'traceback2', 'linecache2', 'click', 'lockfile', 'astroid', 'tox',
'Markdown', 'websocket-client', 'pandas', 'Cython', 'raven', 'mozrunner',
'pytest-runner', 'python-keystoneclient', 'moznetwork', 'python-memcached',
'netifaces', 'functools32', 'mozdevice', 'mozprocess', 'mozprofile',
'mozfile', 'mozinfo', 'pycurl', 'mozlog', 'elasticsearch', 'mozcrash',
'oslo.utils', 'djangorestframework', 'ndg-httpsclient', 'scikit-learn',
'oslo.i18n', 'sqlparse', 'boto3', 'oslo.serialization', 'python-mimeparse',
'python-daemon', 'scipy', 'pyzmq', 'suds', 'wrapt', 'statsd',
'python-novaclient', 'protobuf', 'isodate', 'ply', 'uritemplate',
'requests-oauthlib', 'python-gflags', 'PyMySQL', 'testtools', 'repoze.lru',
'cmd2', 'thrift', 'alembic', 'configobj', 'pexpect', 'cliff', 'coveralls',
'docker-py', 'passlib', 'pytest-cov', 'extras', 'sphinx_rtd_theme',
'matplotlib', 'Unidecode', 'retrying', 'newrelic', 'snowballstemmer',
'BeautifulSoup', 'python-swiftclient', 'eventlet', 'django-debug-toolbar',
'alabaster', 'django-extensions', 'fixtures', 'oauth2', 'WebTest',
'networkx', 'waitress', 'pystache'
'simplejson', 'six', 'botocore', 'python-dateutil', 'pyasn1', 'setuptools',
'requests', 'pyyaml', 'docutils', 's3transfer', 'futures', 'pip',
'jmespath', 'awscli', 'rsa', 'colorama', 'idna', 'certifi', 'urllib3',
'chardet', 'cffi', 'awscli-cwlogs', 'wheel', 'pycparser', 'enum34', 'pbr',
'cryptography', 'virtualenv', 'pytz', 'setuptools-scm', 'jinja2',
'ipaddress', 'markupsafe', 'boto3', 'asn1crypto', 'boto', 'paramiko',
'ptyprocess', 'pexpect', 'pytest-runner', 'psutil', 'flask', 'werkzeug',
'bcrypt', 'pynacl', 'sqlalchemy', 'click', 'numpy', 'pyparsing', 'lxml',
'pyopenssl', 'future', 'decorator', 'vcversioner', 'mock', 'argparse',
'pyasn1-modules', 'jsonschema', 'funcsigs', 'nose', 'tornado', 'httplib2',
'protobuf', 'pandas', 'coverage', 'psycopg2', 'pygments', 'oauth2client',
'singledispatch', 'itsdangerous', 'pytest', 'functools32', 'docopt',
'mccabe', 'babel', 'pillow', 'grpcio', 'backports-abc', 'public',
'query-string', 'redis', 'zope-interface',
'pyflakes', 'pycrypto', 'wrapt', 'django', 'selenium', 'flake8',
'html5lib', 'elasticsearch', 'markdown', 'pycodestyle',
'backports-ssl-match-hostname', 'scipy', 'websocket-client', 'lockfile',
'ipython', 'beautifulsoup4', 'gevent', 'uritemplate', 'pymysql',
'configparser', 'kombu', 'arrow', 'scikit-learn', 'greenlet', 'amqp',
'wcwidth', 'googleapis-common-protos', 'bleach',
'google-api-python-client', 'gunicorn', 'gitpython', 'typing',
'prompt-toolkit', 'google-cloud-core', 'google-gax', 'requests-oauthlib',
'stevedore', 'ordereddict', 'traitlets', 'packaging', 'pymongo',
'ipython-genutils', 'appdirs', 'celery', 'google-auth', 'cython',
'billiard', 'xmltodict', 'pickleshare', 'unittest2', 'simplegeneric',
'msgpack-python', 'snowballstemmer', 'sphinx', 'matplotlib', 'pep8',
'pylint', 'netaddr', 'flask-restful', 'oauthlib', 'linecache2', 'ply',
'traceback2', 'alabaster', 'monotonic', 'olefile', 'isort', 'astroid',
'pyjwt', 'lazy-object-proxy', 'imagesize', 'smmap2', 'gitdb2',
'incremental', 'contextlib2', 'ndg-httpsclient', 'ujson', 'unidecode',
'raven', 'blessings', 'docker-pycreds', 'ansible', 'vine', 'mako',
'netifaces', 'retrying', 'attrs', 'requests-toolbelt', 'supervisor',
'python-daemon', 'sqlparse', 'prettytable', 'iso8601', 'pytest-cov',
'cycler', 'cachetools', 'pyzmq', 'tabulate', 'google-cloud-logging',
'tqdm', 'mozsystemmonitor', 'gapic-google-cloud-logging-v2',
'blobuploader', 'tzlocal', 'tox', 'pluggy', 'xlrd', 'configobj',
'djangorestframework', 'webencodings', 'unicodecsv', 'grpcio-tools',
'pystache', 'meld3', 'mysql-python', 'uwsgi', 'oslo-utils',
'grpc-google-cloud-logging-v2', 'oslo-i18n', 'nbformat', 'statsd',
'debtcollector', 'docker-py', 'oslo-config', 'sphinxcontrib-websupport',
'pathlib2', 'parsedatetime', 'ecdsa', 'oslo-serialization',
'configargparse', 'backports-weakref', 'backports-functools-lru-cache',
'alembic', 'jupyter-core', 'cached-property', 'scandir', 'rfc3986',
'frida', 'subprocess32', 'keystoneauth1', 'thrift', 'jedi', 'ccxt',
'fabric', 'mistune', 'dnspython', 'service-identity', 'datadog',
'python-magic', 'altgraph', 'twisted', 'openpyxl', 'webob', 'macholib',
'docker', 'regex', 'python-keystoneclient',
'backports-shutil-get-terminal-size', 'zope-component', 'python-editor',
'zope-event', 'isodate', 'tensorflow', 'pika', 'anyjson', 'tldextract',
'tensorflow-tensorboard', 'pyrfc3339', 'requests-file', 'networkx',
'easyprocess', 'dockerpty', 'texttable', 'positional', 'python-augeas',
'acme', 'jdcal', 'mmh3', 'dill', 'certbot', 'termcolor', 'nbconvert',
'certbot-apache', 'ipykernel', 'python-mimeparse', 'ruamel-yaml',
'et-xmlfile', 'letsencrypt', 'opencv-python', 'cmd2', 'w3lib', 'cliff',
'jupyter-client', 'ipywidgets', 'passlib', 'gcloud', 'cssselect',
'notebook', 'python-swiftclient', 'widgetsnbextension', 'entrypoints',
'flask-sqlalchemy', 'kazoo', 'defusedxml', 'pandocfilters', 'python-gflags',
'testpath', 'python-memcached', 'keras', 'jsonpatch', 'python-novaclient',
'sympy', 'qtconsole', 'freezegun', 'whichcraft', 'docker-compose',
'binaryornot', 'blinker', 'cookiecutter', 'azure-common', 'jinja2-time',
'poyo', 'certbot-nginx', 'nltk', 'google-cloud-storage', 'sklearn',
'pyhocon', 'django-extensions', 'ua-parser', 'os-client-config',
'jupyter-console', 'inflection', 'newrelic', 'tempita', 'azure-nspkg',
'codecov', 'argh', 'sqlalchemy-migrate', 'requestsexceptions', 'geopy',
'azure-storage', 'pytest-xdist', 'jupyter', 'grpc-google-pubsub-v1',
'faker', 'execnet', 'constantly', 'grpc-google-logging-v2', 'automat',
'argcomplete', 'apipkg', 'wtforms', 'sphinx-rtd-theme', 'aiohttp',
'hyperlink', 'py4j', 'multidict', 'django-filter', 'coala', 'crcmod',
'jsonpointer', 'pytesseract', 'gax-google-pubsub-v1',
'gax-google-logging-v2', 'distribute', 'patsy', 'flask-wtf', 'waitress',
'coveralls', 'pyaml', 'bz2file', 'hjson', 'fake-useragent', 'terminado',
'pyperclip', 'repoze-lru', 'mysqlclient', 'smart-open', 'theano', 'pycurl',
'sqlobject', 'python-glanceclient', 'paste', 'python-cinderclient',
'pathspec', 'watchdog', 'testtools', 'plotly', 'python-openstackclient',
'scrapy-crawlera', 'pathtools', 'azure', 'flask-login', 'aniso8601',
'google-resumable-media', 'python-jenkins', 'slacker', 'xlsxwriter',
'async-timeout', 'pyserial', 'openstacksdk', 'python-jose', 'tenacity',
'python-slugify', 'keyring', 'pkginfo', 'pastedeploy', 'seaborn',
'eventlet', 'google-cloud-bigquery', 'h5py', 'aws-requests-auth',
'maxminddb', 's3cmd', 'django-debug-toolbar', 'flask-script',
'multi-key-dict', 'fuzzywuzzy', 'fasteners', 'youtube-dl',
'pycryptodome', 'smmap', 'gitdb', 'setuptools-git', 'pager',
'python-subunit', 'warlock', 'extras', 'capstone', 'httpretty',
'factory-boy', 'webtest', 'django-cors-headers', 'codeintel', 'suds',
'pyodbc', 'geoip2', 'filechunkio', 'fixtures', 'pysocks', 'statsmodels',
'google-auth-httplib2', 'kafka-python', 'applicationinsights', 'yarl',
'cassandra-driver', 'azure-mgmt-compute', 'pathlib', 'python-jwt', 'sh',
'flask-cors', 'shapely', 'twine', 'taskcluster', 'enum-compat',
'python-twitter', 'cookiejar', 'cookies', 'semantic-version', 'slugid',
'suds-jurko', 'joblib', 'azure-mgmt-network', 'azure-mgmt-resource',
'hiredis', 'pyhawk-with-a-single-extra-commit', 'jws', 'moto', 'bokeh',
'ipaddr', 'invoke', 'azure-mgmt-storage', 'pyxdg', 'azure-mgmt-nspkg',
'pytest-mock', 'google-cloud-pubsub', 'send2trash', 'yarg', 'subliminal',
'pydevd', 'xlwt', 'user-agents', 'python-fanart', 'bs4', 'rtorrent-python',
'django-storages', 'tmdbsimple', 'autopep8', 'pysftp', 'ipdb',
'setproctitle', 'osc-lib', 'importlib', 'validate-email', 'django-appconf',
'bottle', 'hgtools', 'stripe', 'azure-servicebus', 'marshmallow',
'voluptuous', 'ptvsd', 'jsonpickle', 'reportlab', 'python-geohash',
'dicttoxml', 'ddt', 'secretstorage', 'pytest-django', 'flexget',
'httpagentparser', 'beautifulsoup', 'azure-mgmt', 'haversine',
'flower', 'sortedcontainers', 'requests-mock',
'azure-servicemanagement-legacy', 'flask-migrate', 'pyinotify',
'carbon', 'zc-buildout', 'unittest-xml-reporting', 'parse', 'hacking',
'mxnet', 'qds-sdk', 'twilio', 'gspread', 'oslo-log', 'pytest-timeout',
'python-heatclient', 'oslo-context', 'numexpr', 'toolz', 'adal',
'troposphere', 'humanfriendly', 'path-py', 'dogpile-cache', 'plumbum',
'gapic-google-cloud-pubsub-v1', 'graphite-web', 'grpc-google-iam-v1',
'deprecation', 'mpmath', 'oslo-concurrency', 'feedparser', 'python-ldap',
'proto-google-cloud-pubsub-v1', 'pyzabbix', 'humanize', 'colorlog',
'msrestazure', 'msrest', 'python-ironicclient', 'pycountry',
'email-validator', 'hypothesis', 'coala-bears', 'phonenumbers',
'dj-database-url', 'elasticsearch-dsl', 'responses',
'python-neutronclient', 'sasl', 'django-nose', 'munch', 'pydns',
'proto-google-cloud-datastore-v1', 'apscheduler', 'django-redis',
'pytest-forked', 'python-levenshtein', 'dateparser',
'google-cloud-datastore', 'pytimeparse', 'pytest-html',
'virtualenv-clone', 'zope-deprecation', 'django-rest-swagger',
'whitenoise', 'gensim', 'python-consul', 'pypdf2', 'pydispatcher',
'scp', 'requires', 'cement', 'cx-oracle', 'graphviz', 'slackclient',
'hponeview', 'croniter', 'cssutils', 'appier', 'jsonpath-rw',
'requests-futures', 'mrjob', 'cachet', 'influxdb', 'virtualenvwrapper',
'appnope', 'pymssql', 'testfixtures', 'glob2', 'django-model-utils',
'awsebcli', 'tweepy', 'gapic-google-cloud-datastore-v1', 'coreapi',
'bkcharts', 'requests-ntlm', 'sqlalchemy-utils', 'more-itertools',
'testrepository', 'blessed', 'jsonfield', 'logilab-common',
'flake8-import-order', 'parse-type', 'clint', 'queuelib', 'robotframework',
'python-gnupg', 'tensorflow-gpu', 'jira', 'gcdt-bundler',
'azure-mgmt-redis', 'avro', 'args', 'pythonwhois', 'pyhamcrest',
'scrapy', 'ruamel-ordereddict', 'retry', 'azure-mgmt-batch',
'azure-batch', 'junit-xml', 'django-compressor', 'pyvirtualdisplay',
'python-openid', 'itypes', 'flask-cache', 'azure-mgmt-keyvault',
'pip-tools', 'apache-libcloud', 'inflect', 'django-celery', 'routes',
'google-apputils', 'bitarray', 'websockets', 'cherrypy', 'pyhive',
'os-testr', 'whoosh', 'django-braces', 'findspark', 'parsel',
'zope-exceptions', 'coreschema', 'ntlm-auth', 'fake-factory',
'enum', 'googleads', 'iptools', 'google-cloud-translate',
'google-cloud', 'pywinrm', 'google-cloud-vision', 'google-cloud-language',
'brotlipy', 'google-cloud-bigtable', 'google-cloud-error-reporting',
'oslo-messaging', 'zope-testrunner', 'google-cloud-monitoring', 'awacs',
'pydocstyle', 'lmdb', 'django-crispy-forms', 'jellyfish',
'google-cloud-speech', 'google-cloud-runtimeconfig', 'testscenarios',
'first', 'py-zabbix', 'bcdoc', 'azure-mgmt-web', 'google-cloud-dns',
'google-cloud-resource-manager', 'google-compute-engine', 'oslo-db',
'autobahn', 'ldap3', 'azure-mgmt-monitor', 'proto-google-cloud-logging-v2',
'azure-mgmt-trafficmanager', 'pypiwin32', 'azure-mgmt-cdn',
'oslo-middleware', 'azure-mgmt-authorization', 'google-cloud-spanner',
'python-json-logger', 'datetime', 'eggtestinfo', 'thriftpy', 'nosexcover',
'falcon', 'csvkit', 'ggplot', 'pyramid', 'pg8000', 'munkres', 'futurist',
'ciso8601', 'azure-graphrbac', 'python-dotenv', 'py2-ipaddress', 'peewee',
'brewer2mpl', 'dulwich', 'zeep', 'azure-mgmt-cognitiveservices',
'translationstring', 'sendgrid', 'xgboost', 'aws', 'prometheus-client',
'runcython', 'azure-mgmt-sql', 'kubernetes', 'oslo-service', 'annoy',
'oauth2', 'dbfread', 'mox3', 'wincertstore', 'initools', 'scikit-image',
'backport-collections', 'commonmark', 'pyproj', 'behave', 'qrcode',
'azure-mgmt-dns', 'azure-datalake-store',
'gapic-google-cloud-error-reporting-v1beta1', 'requests-aws4auth',
'flask-admin', 'pygame', 'cov-core', 'gapic-google-cloud-spanner-v1',
'agate', 'gapic-google-cloud-spanner-admin-database-v1',
'openstackdocstheme', 'azure-mgmt-containerregistry',
'djangorestframework-jwt',
'proto-google-cloud-error-reporting-v1beta1',
'proto-google-cloud-spanner-admin-database-v1',
'gapic-google-cloud-spanner-admin-instance-v1',
'azure-mgmt-datalake-store', 'proto-google-cloud-spanner-v1',
'proto-google-cloud-spanner-admin-instance-v1', 'runtime',
'azure-mgmt-datalake-analytics', 'oslotest', 'txaio', 'django-mptt',
'azure-keyvault', 'azure-mgmt-iothub', 'azure-mgmt-documentdb',
'oslo-policy', 'shade', 'pywavelets', 'flask-mail',
'azure-mgmt-devtestlabs', 'atx', 'azure-mgmt-scheduler', 'wand',
'azure-mgmt-datalake-nspkg', 'azure-mgmt-rdbms', 'empy',
'azure-mgmt-common', 'venusian', 'cairocffi', 'pysubnettree',
'agate-excel', 'toml', 'pyvmomi', 'oslosphinx', 'cchardet',
'requesocks', 'agate-dbf', 'openapi-codec', 'pylibmc', 'reno',
'httpbin', 'google-cloud-videointelligence', 'udatetime', 'pyroute2',
'flake8-docstrings', 'autograd', 'nodeenv', 'logutils', 'rq',
'azure-servicefabric', 'mongoengine', 'pycryptodomex', 'azure-mgmt-logic',
'leather', 'agate-sql', 'python-logstash', 'delorean', 'thrift-sasl',
'jpype1', 'shutit', 'wordsegment', 'flufl-enum', 'rjsmin', 'html2text',
'watchtower', 'pymeta3', 'netius', 'cairosvg', 'pybars3', 'recommonmark',
'uritemplate-py', 'fakeredis', 'python3-openid', 'filelock', 'jsmin',
'pipenv', 'django-environ', 'pyhs2', 'pep8-naming', 'typed-ast', 'pyusb',
'dedupe', 'dateutils', 'tablib', 'luigi', 'pysnmp', 'prettyplotlib',
'pre-commit', 'polib', 'jenkinsapi', 'rcssmin', 'ptable', 'multiprocess',
'pymc', 'pytest-metadata', 'django-oauth-toolkit', 'django-allauth',
'pygithub', 'python-crfsuite', 'python-cdb', 'pydas', 'pytest-cache',
'pyspin', 'pypi-publisher', 'pika-pool', 'pulp', 'pyinstaller',
'profilehooks', 'jenkins-job-builder', 'clickclick', 'urwid', 'pep257',
'sirepo', 'bandit', 'google-apitools', 'zope-proxy', 'cvxopt',
'pytest-catchlog', 'pybrain', 'gdata', 'toil', 'mypy',
'python2-pythondialog', 'pypng', 'sure', 'yamllint',
'robotframework-selenium2library', 'll-xist', 'tempora', 'webassets',
'pycadf', 'dropbox', 'pypandoc', 'django-taggit', 'paho-mqtt',
'keystonemiddleware', 'livereload', 'psycogreen', 'geocoder', 'ftfy',
'yapf', 'glances', 'grequests', 'coloredlogs', 'python-http-client',
'parsley', 'nose-exclude', 'transaction', 'flask-swagger', 'homeassistant',
'hvac', 'vcrpy', 'github3-py', 'schematics', 'tinycss',
'swagger-spec-validator', 'progressbar2', 'pydot', 'backoff', 'pytsite',
'scapy', 'attrdict', 'shellescape', 'impyla', 'flatten-dict',
'requests-kerberos', 'pykerberos', 'repoze-who', 'mxnet-mkl', 'cssmin',
'dask', 'cheroot', 'flake8-polyfill', 'pyotp', 'python-designateclient',
'simple-salesforce', 'hupper', 'neutron-lib', 'wavefront-cli', 'deepdiff',
'connexion', 'phonenumberslite', 'natsort', 'tox-travis', 'btrees',
'rednose', 'flask-testing', 'premailer', 'shortuuid', 'django-countries',
'ocflib', 'pylint-plugin-utils', 'pyenchant', 'logging', 'pysmi',
'appier-extras', 'zc-recipe-egg', 'oslo-rootwrap', 'flaky', 'libsass',
'oslo-versionedobjects', 'ipy', 'pecan', 'diff-match-patch',
'oslo-reports', 'google', 'aspen', 'rollbar', 'cobra',
'restructuredtext-lint', 'pythonnet', 'line-profiler', 'trollius',
'django-bootstrap3', 'pygeoip', 'django-picklefield', 'django-reversion',
'cytoolz', 'beaker', 'tooz', 'flask-assets', 'uuid', 'osprofiler',
'bitstring', 'naked', 'flask-babel', 'plac', 'semver', 'django-formtools',
'python-snappy', 'persistent', 'terminaltables', 'taskflow', 'boxsdk',
'cerberus', 'flask-principal', 'thinc', 'spacy', 'pycares', 'pylru',
'kafka', 'pkgconfig', 'couchbase', 'python-utils', 'django-localflavor',
'django-redis-cache', 'webapp2', 'sqlalchemy-redshift', 'salt',
'structlog', 'mandrill', 'googlemaps', 'easy-thumbnails', 'automaton',
'webcolors'
]


def suggest_package(package):
"""Suggests a package name, given a package name."""
THRESHOLD = 90
results = fuzzywuzzy.process.extract(package, packages, limit=1)
for result in results:
if result[1] > THRESHOLD:
return result[0]
THRESHOLD = 86

# Bypass for speed.
if package in packages:
return package

result = fuzzywuzzy.process.extractOne(package, packages)
# print(result)
if result[1] > THRESHOLD:
return result[0]

def python_version(path_to_python):
if not path_to_python:
Expand Down

0 comments on commit aeaabf4

Please sign in to comment.