Function to convert a short (15 character) Salesforce ID into a long (18 character) Salesforce ID.
from sfid import to_long_id
short_id = '001A0000006Vm9r'
long_id = to_long_id(short_id)
self.assertEquals(short_id + 'IAC', to_long_id(short_id))
The algorithm for converting a short Salesforce ID into a long one is described here: https://astadiaemea.wordpress.com/2010/06/21/15-or-18-character-ids-in-salesforce-com-%E2%80%93-do-you-know-how-useful-unique-ids-are-to-your-development-effort/