This work which is called PySimulator includes simulating under DC/AC/TRAN and also supports OP command. This PySimulator can simulate not only linear elements and also nonlinear elements like diode and mos.
In addition, it is easy to exapand the function to dynamic time step control and memristor simulation. Also, adding memristor simulation is also easy.