Schemdraw

0.22 · active · verified Tue Apr 14

Schemdraw is a Python package for producing high-quality electrical circuit schematic diagrams. It allows users to create diagrams by adding circuit elements one at a time using Python methods. It supports a wide range of components including resistors, capacitors, diodes, transistors, opamps, logic gates, and can also generate timing diagrams, state machine diagrams, and flowcharts. The current version is 0.22 and it has an active development and release cadence.

Warnings

Install

Imports

Quickstart

This quickstart code creates a simple RC circuit diagram and saves it as an SVG file. The `with schemdraw.Drawing():` context manager is the recommended modern approach for creating and saving drawings, handling display and saving automatically upon exit.

import schemdraw
import schemdraw.elements as elm

with schemdraw.Drawing(file='basic_rc_circuit.svg') as d:
    d += elm.Resistor().right().label('1Ω')
    d += elm.Capacitor().down().label('10μF')
    d += elm.Line().left()
    d += elm.SourceSin().up().label('10V')
# The drawing is automatically saved to 'basic_rc_circuit.svg' upon exiting the 'with' block.

view raw JSON →