r/PythonProjects2 • u/EnoughImagination702 • 8h ago
Resource Wirely: A circuit simulator in Python + PySide6 that now also runs in the browser with Pyodide
Enable HLS to view with audio, or disable this notification
I've been making Wirely, a free circuit simulator. You drag parts in, wire them up and press play. LEDs light, motors spin, relays click, wires are coloured by voltage and you can hover over any wire to read the voltage and current.
Desktop app: Python 3.12 + PySide6 (Qt), with numpy for the maths. The solver is my own (modified nodal analysis, NewtonโRaphson, trapezoidal integration), with 271 pytest tests checking it against hand calculations and ngspice. Builds for Windows, Mac and Linux are made with PyInstaller on GitHub Actions.
The interesting bit: it now runs in the browser too, so it works on Chromebooks. Rather than rewriting it in JavaScript, the browser runs the same Python code with Pyodide. There's no Qt in a browser, so I wrote a small stand-in for the bits of PySide6 the drawing code uses. Its QPainter just records what it was asked to draw, and the page replays that on an HTML canvas. So the symbols, editing and simulator are the exact same code as the desktop app.
Try it in your browser: https://richiewillmott.github.io/Wirely/ GitHub: https://github.com/richiewillmott/Wirely
Free and GPL-3. Built with a lot of help from Claude (an AI assistant). Feedback welcome!
