Connecting databases from python