Thursday, 7 January 2010

A configuration file with an encrypted password in Python

I need to set configuration by environment in quite a few Python utils. I'd like to create an object with a filename as a constructor variable, and then get a dict of the values. One issue is the password -  better not to keep it in plain text. So I need to make them "encrypted", or a better phrase might be "non-human readable".

I got my head round the python unittest framework when writing this, and also got my head round the ConfigParser and optparse libraries.

1 comment: