Is PyPI case sensitive?

Posted on

Question :

Is PyPI case sensitive?

How does PyPI handle case sensitivity?

For example, this SO question documents PyPI refusing a new package foobar if FooBar already exists.

Running pip against seems to convert to the canonical case for a package:

$ pip install django
Downloading/unpacking django
  Downloading Django-1.7.tar.gz (7.5MB): 7.5MB downloaded


$ pip install Django
Downloading/unpacking Django
  Downloading Django-1.7.tar.gz (7.5MB): 7.5MB downloaded

However, only some files seem to be in the canonical case in my virtualenv:

$ ls ~/pyenvs/test_venv/lib/python2.7/site-packages/ | grep -i django

What does the XML-RPC API expect? Can I always assume that and will both return HTTP 200?

Is PyPI’s position on case-sensitivity documented anywhere?

Answer #1:

No, pip is case insensitive.

All comparisons of distribution names MUST be case insensitive, and MUST consider hyphens and underscores to be equivalent.

from PEP 426

Answered By: Most Wanted

Leave a Reply

Your email address will not be published. Required fields are marked *