simLAB is a pure Python tool for editing and simulating a SIM card. Together with simTrace HW, it allows modification of APDU exchanged between the Terminal (Mobile Equipment) and the SIM.
Want to learn more? Detailed information can be found in the simLAB wiki