use python to handle db