class PyPIConfig(configparser.RawConfigParser):

    def __init__(self):
        """
        Load from ~/.pypirc
        """
defaults = dict.fromkeys(['username', 'password', 'repository'], '')
configparser.RawConfigParser.__init__(self, defaults)
rc = os.path.join(os.path.expanduser('~'), '.pypirc')
if os.path.exists(rc):
    self.read(rc)
Custom location for .pypirc file