Swoop: A Python Library for Eagle PCB Design Files¶
Introduction¶
Swoop is a library of Python objects for representing and manipulating Cadsoft Eagle board, schematic, and library files used in designing printed circuit boards (PCBs). It parses an input Eagle file, creates a internal representation data structure that represents the file’s contents, provides accessors and mutators to query, read, and modify those contents, and generates valid Eagle files as output.
Swoop uses several different objects to represent and manipulate Eagle files.
- EagleFilePart Swoop use a tree of
EagleFilePart
objects to represent an Eagle file. There many subclasses ofEagleFilePart
that correspond to different parts of the file.- Utility classes Most notably
From
which provides a fluent interface for Eagle files andEagleFilePartVisitor
which implements a visitor framework for Swoop data structures.- Exception classes For reporting errors.
In addition, Swoop provides a several mechanisms for extending its functionality.
Because the Swoop data structures map (almost) directly to Eagle file structures, some understanding of the Eagle file format is necessary in order to use Swoop. However, it is possible to use Swoop without understanding all the details the format. The eagle.dtd that ships with Eagle (in the ‘doc’ directory) is a good place to start learning about the file format. If you are familiar with Eagle, the file format is relatively easy to understand.
The code for most of Swoop is autogenerated by a Python script called
GenerateSwoop.py
using the Jinja templating system.
Swoop was created by the NVSL at UCSD as part of the Gadgetron project.
This is the documentation for Swoop 0.3.
Contents¶
- Installing Swoop
- EagleFilePart and Its Subclasses
- EagleFile Base Class
- Classes for Board Files (.brd)
- Classes for Schematic Files (.sch)
- Classes for Library Files (.lbr)
- Miscellaneous Classes
- Quickly Querying Swoop Objects
- Exceptions
- Extending Swoop
- Swoop Utilities
- Examples
- Building the Swoop Library