I wrote a Python-based tool that can simulate AC signals and noise using the sparse matrix solvers provided by SciPy. It is an open source project based on a closed source tool in the gravitational wave community called LISO.
I have structured the code in a way that you can build different solving libraries or create different analyses that use the same circuit definition. Both analysis types that exist as of writing (signal and noise analyses) build a matrix from the circuit components and then solve it for a given excitation, e.g. an input, over a given frequency range.
It is similar to the way SPICE and other nodal analysis circuit simulators work. I hope the code is relatively easy to understand.
There is some basic documentation here, but it is still in development. Let me know if you end up using it and have questions about how it works.
Here is an example of LISO syntax that it supports (but you can also define circuits purely in Python). It is a little like a SPICE netlist:
r r1 100 nin nsum
r r3 1.075k no nsum
r r4 42.2 nsum nm
r r6 65 nin gnd
c c2 4.7n nsum gnd
c c5 122p no nm
op op1 op27 gnd nm no
freq log 1 1M 101
uinput nin nsum 50
uoutput no nsum
The above code produces a plot like this: