Transaction management for Python