Skip to main content

A Python package for textually describing electronic circuit schematics.

Project description

https://img.shields.io/pypi/v/skidl.svg

SKiDL is a module that allows you to compactly describe the interconnection of electronic circuits and components using Python. The resulting Python program performs electrical rules checking for common mistakes and outputs a netlist that serves as input to a PCB layout tool.

Features

  • Has a powerful, flexible syntax (because it is Python).

  • Permits compact descriptions of electronic circuits (think about not tracing signals through a multi-page schematic).

  • Allows textual descriptions of electronic circuits (think about using diff and git for circuits).

  • Performs electrical rules checking (ERC) for common mistakes (e.g., unconnected device I/O pins).

  • Supports linear / hierarchical / mixed descriptions of electronic designs.

  • Fosters design reuse (think about using PyPi and Github to distribute electronic designs).

  • Makes possible the creation of smart circuit modules whose behavior / structure are changed parametrically (think about filters whose component values are automatically adjusted based on your desired cutoff frequency).

  • Can work with any ECAD tool (only two methods are needed: one for reading the part libraries and another for outputing the correct netlist format).

  • Takes advantage of all the benefits of the Python ecosystem (because it is Python).

As a very simple example, the SKiDL program below describes a circuit that takes an input voltage, divides it by three, and outputs it:

from skidl import *

gnd = Net('GND')  # Ground reference.
vin = Net('VI')   # Input voltage to the divider.
vout = Net('VO')  # Output voltage from the divider.
r1, r2 = 2 * Part('device', 'R', TEMPLATE)  # Create two resistors.
r1.value, r1.footprint = '1K',  'Resistors_SMD:R_0805'  # Set resistor values
r2.value, r2.footprint = '500', 'Resistors_SMD:R_0805'  # and footprints.
r1[1] += vin      # Connect the input to the first resistor.
r2[2] += gnd      # Connect the second resistor to ground.
vout += r1[2], r2[1]  # Output comes from the connection of the two resistors.

generate_netlist()

And this is the output that can be fed to a program like KiCad’s PCBNEW to create the physical PCB:

(export (version D)
  (design
    (source "C:/Users/DEVB/PycharmProjects/test1\test.py")
    (date "08/12/2016 11:13 AM")
    (tool "SKiDL (0.0.1)"))
  (components
    (comp (ref R1)
      (value 1K)
      (footprint Resistors_SMD:R_0805))
    (comp (ref R2)
      (value 500)
      (footprint Resistors_SMD:R_0805)))
  (nets
    (net (code 0) (name "VI")
      (node (ref R1) (pin 1)))
    (net (code 1) (name "GND")
      (node (ref R2) (pin 2)))
    (net (code 2) (name "VO")
      (node (ref R1) (pin 2))
      (node (ref R2) (pin 1))))
)

History

0.0.9 (2017-02-16)

  • Use getattr() instead of __class__.__dict__ so that subclasses of SKiDL objects can find attributes named within strings without searching the __mor__.

0.0.8 (2017-01-11)

  • skidl_to_netlist now uses templates.

  • Default operation of search() is now less exacting.

  • Traceback is now suppressed if show() is passed a part name not in a library.

0.0.7 (2016-09-11)

  • Lack of KISYSMOD environment variable no longer causes an exception.

  • requirements.txt file now references the requirements from setup.py.

  • Changed setup so it generates a pckg_info file with version, author, email.

0.0.6 (2016-09-10)

  • Fixed error caused when trying to find script name when SKiDL is run in interactive mode.

  • Silenced errors/warnings when loading KiCad part description (.dcm) files.

0.0.5 (2016-09-07)

  • SKiDL now searches for parts with a user-configurable list of library search paths.

  • Part descriptions and keywords are now loaded from the .dcm file associated with a .lib file.

0.0.4 (2016-08-27)

  • SKiDL scripts can now output netlists in XML format.

0.0.3 (2016-08-25)

  • Added command-line utility to convert netlists into SKiDL programs.

0.0.2 (2016-08-17)

  • Changed the link to the documentation.

0.0.1 (2016-08-16)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skidl-0.0.10.zip (222.6 kB view details)

Uploaded Source

File details

Details for the file skidl-0.0.10.zip.

File metadata

  • Download URL: skidl-0.0.10.zip
  • Upload date:
  • Size: 222.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for skidl-0.0.10.zip
Algorithm Hash digest
SHA256 cb9b2048cebfc4c67530f86bc1564b436a7b4dcbdcc3c8234a04572cefbb1bc1
MD5 c2c69d837bb03c42bebf8590fadabd12
BLAKE2b-256 351d7221be9e71cd584db25f1c8937fa689c87e5b8350f70cbf45fb1c2294c61

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page