Run Ngspice in batch mode or with python
Following @aconcernedcitizen's comment, the command to be used in order to run Ngspice in batch mode from python is the following:
subprocess.run([path_to_ngspice_executable,'-r','rawfile.raw','-b','-i',my_netlist]).
Where rawfile.raw here will contain all the voltages distributions and is supposed to be read to extract the voltage distribution. For LTspice the ltspice python package see here, whereas for Ngspice raw files I am still trying to figure it out...