Okay, got it working (bsddb I mean).
If anyone is interested, first update python2.5-minimal 2.5.4-1maemo6 and then python2.5_2.5.4-1maemo6.
After that you can import bsddb, now it's just a matter of coding a small python program that exports contacts.
Thanks for your help.
Regards,
Jarkko