Miscellaneous Classes

These classes are used across .brd, .sch, and .lbr files. They represent Eagle attributes, drawn elements, documentation, and other information.

Attribute

class Swoop.Attribute[source]

Bases: Swoop.Swoop.Base_Attribute

Extra functionality for Attributes. Attributes are used in many places in eagle files and they require different attributes in some cases.

Text

class Swoop.Text[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <text> tag in Eagle files.

Attributes:

  • x
  • y
  • size
  • layer
  • font
  • ratio
  • rot
  • align
  • distance
clone()[source]

Recursively clone this Text. It will be identical to the original, but it’s parent will be None.

Return type:Text
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_align()[source]

Return the value of align for this Text. This corresponds to the align attribute of a <text> in an Eagle file.

Return type:str
get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_distance()[source]

Return the value of distance for this Text. This corresponds to the distance attribute of a <text> in an Eagle file.

Return type:int
get_et()[source]

Generate a <text> element tree for a Text.

Return type:ElementTree.
get_font()[source]

Return the value of font for this Text. This corresponds to the font attribute of a <text> in an Eagle file.

Return type:str
get_layer()[source]

Return the value of layer for this Text. This corresponds to the layer attribute of a <text> in an Eagle file.

Return type:layer_string
get_ratio()[source]

Return the value of ratio for this Text. This corresponds to the ratio attribute of a <text> in an Eagle file.

Return type:int
get_rot()[source]

Return the value of rot for this Text. This corresponds to the rot attribute of a <text> in an Eagle file.

Return type:str
get_size()[source]

Return the value of size for this Text. This corresponds to the size attribute of a <text> in an Eagle file.

Return type:float
get_x()[source]

Return the value of x for this Text. This corresponds to the x attribute of a <text> in an Eagle file.

Return type:float
get_y()[source]

Return the value of y for this Text. This corresponds to the y attribute of a <text> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_align(v)[source]

Set the value of align for this Text. This corresponds to the align attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_distance(v)[source]

Set the value of distance for this Text. This corresponds to the distance attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_font(v)[source]

Set the value of font for this Text. This corresponds to the font attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_layer(v)[source]

Set the value of layer for this Text. This corresponds to the layer attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_ratio(v)[source]

Set the value of ratio for this Text. This corresponds to the ratio attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_rot(v)[source]

Set the value of rot for this Text. This corresponds to the rot attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_size(v)[source]

Set the value of size for this Text. This corresponds to the size attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x(v)[source]

Set the value of x for this Text. This corresponds to the x attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y(v)[source]

Set the value of y for this Text. This corresponds to the y attribute of a <text> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_align(v)[source]

Filter this EagleFilePart object based on the value of align. For use in combination with From objects.

Return self if one of the following is true:

  1. align equals v
  2. v is callable and v(self.get_align() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_distance(v)[source]

Filter this EagleFilePart object based on the value of distance. For use in combination with From objects.

Return self if one of the following is true:

  1. distance equals v
  2. v is callable and v(self.get_distance() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_font(v)[source]

Filter this EagleFilePart object based on the value of font. For use in combination with From objects.

Return self if one of the following is true:

  1. font equals v
  2. v is callable and v(self.get_font() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_layer(v)[source]

Filter this EagleFilePart object based on the value of layer. For use in combination with From objects.

Return self if one of the following is true:

  1. layer equals v
  2. v is callable and v(self.get_layer() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_ratio(v)[source]

Filter this EagleFilePart object based on the value of ratio. For use in combination with From objects.

Return self if one of the following is true:

  1. ratio equals v
  2. v is callable and v(self.get_ratio() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_rot(v)[source]

Filter this EagleFilePart object based on the value of rot. For use in combination with From objects.

Return self if one of the following is true:

  1. rot equals v
  2. v is callable and v(self.get_rot() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_size(v)[source]

Filter this EagleFilePart object based on the value of size. For use in combination with From objects.

Return self if one of the following is true:

  1. size equals v
  2. v is callable and v(self.get_size() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_text(v)[source]

Filter this EagleFilePart object based on the value of text. For use in combination with From objects.

Return self if one of the following is true:

  1. text equals v
  2. v is callable and v(self.get_text() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x(v)[source]

Filter this EagleFilePart object based on the value of x. For use in combination with From objects.

Return self if one of the following is true:

  1. x equals v
  2. v is callable and v(self.get_x() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y(v)[source]

Filter this EagleFilePart object based on the value of y. For use in combination with From objects.

Return self if one of the following is true:

  1. y equals v
  2. v is callable and v(self.get_y() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Wire

class Swoop.Wire[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <wire> tag in Eagle files.

Attributes:

  • x1
  • y1
  • x2
  • y2
  • width
  • layer
  • extent
  • style
  • curve
  • cap
clone()[source]

Recursively clone this Wire. It will be identical to the original, but it’s parent will be None.

Return type:Wire
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_cap()[source]

Return the value of cap for this Wire. This corresponds to the cap attribute of a <wire> in an Eagle file.

Return type:str
get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_curve()[source]

Return the value of curve for this Wire. This corresponds to the curve attribute of a <wire> in an Eagle file.

Return type:float
get_et()[source]

Generate a <wire> element tree for a Wire.

Return type:ElementTree.
get_extent()[source]

Return the value of extent for this Wire. This corresponds to the extent attribute of a <wire> in an Eagle file.

Return type:str
get_layer()[source]

Return the value of layer for this Wire. This corresponds to the layer attribute of a <wire> in an Eagle file.

Return type:layer_string
get_style()[source]

Return the value of style for this Wire. This corresponds to the style attribute of a <wire> in an Eagle file.

Return type:str
get_width()[source]

Return the value of width for this Wire. This corresponds to the width attribute of a <wire> in an Eagle file.

Return type:float
get_x1()[source]

Return the value of x1 for this Wire. This corresponds to the x1 attribute of a <wire> in an Eagle file.

Return type:float
get_x2()[source]

Return the value of x2 for this Wire. This corresponds to the x2 attribute of a <wire> in an Eagle file.

Return type:float
get_y1()[source]

Return the value of y1 for this Wire. This corresponds to the y1 attribute of a <wire> in an Eagle file.

Return type:float
get_y2()[source]

Return the value of y2 for this Wire. This corresponds to the y2 attribute of a <wire> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_cap(v)[source]

Set the value of cap for this Wire. This corresponds to the cap attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_curve(v)[source]

Set the value of curve for this Wire. This corresponds to the curve attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_extent(v)[source]

Set the value of extent for this Wire. This corresponds to the extent attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_layer(v)[source]

Set the value of layer for this Wire. This corresponds to the layer attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_style(v)[source]

Set the value of style for this Wire. This corresponds to the style attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_width(v)[source]

Set the value of width for this Wire. This corresponds to the width attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x1(v)[source]

Set the value of x1 for this Wire. This corresponds to the x1 attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x2(v)[source]

Set the value of x2 for this Wire. This corresponds to the x2 attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y1(v)[source]

Set the value of y1 for this Wire. This corresponds to the y1 attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y2(v)[source]

Set the value of y2 for this Wire. This corresponds to the y2 attribute of a <wire> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_cap(v)[source]

Filter this EagleFilePart object based on the value of cap. For use in combination with From objects.

Return self if one of the following is true:

  1. cap equals v
  2. v is callable and v(self.get_cap() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_curve(v)[source]

Filter this EagleFilePart object based on the value of curve. For use in combination with From objects.

Return self if one of the following is true:

  1. curve equals v
  2. v is callable and v(self.get_curve() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_extent(v)[source]

Filter this EagleFilePart object based on the value of extent. For use in combination with From objects.

Return self if one of the following is true:

  1. extent equals v
  2. v is callable and v(self.get_extent() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_layer(v)[source]

Filter this EagleFilePart object based on the value of layer. For use in combination with From objects.

Return self if one of the following is true:

  1. layer equals v
  2. v is callable and v(self.get_layer() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_style(v)[source]

Filter this EagleFilePart object based on the value of style. For use in combination with From objects.

Return self if one of the following is true:

  1. style equals v
  2. v is callable and v(self.get_style() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_width(v)[source]

Filter this EagleFilePart object based on the value of width. For use in combination with From objects.

Return self if one of the following is true:

  1. width equals v
  2. v is callable and v(self.get_width() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x1(v)[source]

Filter this EagleFilePart object based on the value of x1. For use in combination with From objects.

Return self if one of the following is true:

  1. x1 equals v
  2. v is callable and v(self.get_x1() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x2(v)[source]

Filter this EagleFilePart object based on the value of x2. For use in combination with From objects.

Return self if one of the following is true:

  1. x2 equals v
  2. v is callable and v(self.get_x2() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y1(v)[source]

Filter this EagleFilePart object based on the value of y1. For use in combination with From objects.

Return self if one of the following is true:

  1. y1 equals v
  2. v is callable and v(self.get_y1() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y2(v)[source]

Filter this EagleFilePart object based on the value of y2. For use in combination with From objects.

Return self if one of the following is true:

  1. y2 equals v
  2. v is callable and v(self.get_y2() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Polygon

class Swoop.Polygon[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <polygon> tag in Eagle files.

Attributes:

  • width
  • layer
  • spacing
  • pour
  • isolate
  • orphans
  • thermals
  • rank

Collections:

  • vertex: List of Vertex objects.
add_vertex(s)[source]

Add a Vertex to the vertices of this Polygon.

Parameters:s – The Vertex to add.
Return type:self
clear_vertices()[source]

Remove all the Vertex objects from the vertices of this Polygon.

Return type:self
clone()[source]

Recursively clone this Polygon. It will be identical to the original, but it’s parent will be None.

Return type:Polygon
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <polygon> element tree for a Polygon.

Return type:ElementTree.
get_isolate()[source]

Return the value of isolate for this Polygon. This corresponds to the isolate attribute of a <polygon> in an Eagle file.

Return type:float
get_layer()[source]

Return the value of layer for this Polygon. This corresponds to the layer attribute of a <polygon> in an Eagle file.

Return type:layer_string
get_nth_vertex(n)[source]

get then nth Vertex object from the vertices of this Polygon.

Parameters:n – Index of the item to return.
Return type:Vertex object
get_orphans()[source]

Return the value of orphans for this Polygon. This corresponds to the orphans attribute of a <polygon> in an Eagle file.

Return type:bool
get_pour()[source]

Return the value of pour for this Polygon. This corresponds to the pour attribute of a <polygon> in an Eagle file.

Return type:str
get_rank()[source]

Return the value of rank for this Polygon. This corresponds to the rank attribute of a <polygon> in an Eagle file.

Return type:int
get_spacing()[source]

Return the value of spacing for this Polygon. This corresponds to the spacing attribute of a <polygon> in an Eagle file.

Return type:float
get_thermals()[source]

Return the value of thermals for this Polygon. This corresponds to the thermals attribute of a <polygon> in an Eagle file.

Return type:bool
get_vertices(attrs=None, type=None)[source]

Return (and possibly filter) items in the the vertices list of Vertex objects for this Polygon.

This functions provides a mechanism for filtering the items as well. The keys in attrs are taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.

A if type is not None, the item will match if it is an instance of the type provided.

Parameters:
  • attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
  • type – A type to filter on. Only items that are an instance of this type will be returned.
Returns:

A List of Vertex objects

Return type:

List of Vertex objects

get_width()[source]

Return the value of width for this Polygon. This corresponds to the width attribute of a <polygon> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
remove_vertex(efp)[source]

Remove a Vertex from the vertices of this Polygon.

Parameters:efp – The Vertex object to remove.
Return type:self
set_isolate(v)[source]

Set the value of isolate for this Polygon. This corresponds to the isolate attribute of a <polygon> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_layer(v)[source]

Set the value of layer for this Polygon. This corresponds to the layer attribute of a <polygon> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_orphans(v)[source]

Set the value of orphans for this Polygon. This corresponds to the orphans attribute of a <polygon> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_pour(v)[source]

Set the value of pour for this Polygon. This corresponds to the pour attribute of a <polygon> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_rank(v)[source]

Set the value of rank for this Polygon. This corresponds to the rank attribute of a <polygon> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_spacing(v)[source]

Set the value of spacing for this Polygon. This corresponds to the spacing attribute of a <polygon> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_thermals(v)[source]

Set the value of thermals for this Polygon. This corresponds to the thermals attribute of a <polygon> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_width(v)[source]

Set the value of width for this Polygon. This corresponds to the width attribute of a <polygon> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_isolate(v)[source]

Filter this EagleFilePart object based on the value of isolate. For use in combination with From objects.

Return self if one of the following is true:

  1. isolate equals v
  2. v is callable and v(self.get_isolate() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_layer(v)[source]

Filter this EagleFilePart object based on the value of layer. For use in combination with From objects.

Return self if one of the following is true:

  1. layer equals v
  2. v is callable and v(self.get_layer() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_orphans(v)[source]

Filter this EagleFilePart object based on the value of orphans. For use in combination with From objects.

Return self if one of the following is true:

  1. orphans equals v
  2. v is callable and v(self.get_orphans() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_pour(v)[source]

Filter this EagleFilePart object based on the value of pour. For use in combination with From objects.

Return self if one of the following is true:

  1. pour equals v
  2. v is callable and v(self.get_pour() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_rank(v)[source]

Filter this EagleFilePart object based on the value of rank. For use in combination with From objects.

Return self if one of the following is true:

  1. rank equals v
  2. v is callable and v(self.get_rank() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_spacing(v)[source]

Filter this EagleFilePart object based on the value of spacing. For use in combination with From objects.

Return self if one of the following is true:

  1. spacing equals v
  2. v is callable and v(self.get_spacing() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_thermals(v)[source]

Filter this EagleFilePart object based on the value of thermals. For use in combination with From objects.

Return self if one of the following is true:

  1. thermals equals v
  2. v is callable and v(self.get_thermals() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_width(v)[source]

Filter this EagleFilePart object based on the value of width. For use in combination with From objects.

Return self if one of the following is true:

  1. width equals v
  2. v is callable and v(self.get_width() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Rectangle

class Swoop.Rectangle[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <rectangle> tag in Eagle files.

Attributes:

  • x1
  • y1
  • x2
  • y2
  • layer
  • rot
clone()[source]

Recursively clone this Rectangle. It will be identical to the original, but it’s parent will be None.

Return type:Rectangle
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <rectangle> element tree for a Rectangle.

Return type:ElementTree.
get_layer()[source]

Return the value of layer for this Rectangle. This corresponds to the layer attribute of a <rectangle> in an Eagle file.

Return type:layer_string
get_rot()[source]

Return the value of rot for this Rectangle. This corresponds to the rot attribute of a <rectangle> in an Eagle file.

Return type:str
get_x1()[source]

Return the value of x1 for this Rectangle. This corresponds to the x1 attribute of a <rectangle> in an Eagle file.

Return type:float
get_x2()[source]

Return the value of x2 for this Rectangle. This corresponds to the x2 attribute of a <rectangle> in an Eagle file.

Return type:float
get_y1()[source]

Return the value of y1 for this Rectangle. This corresponds to the y1 attribute of a <rectangle> in an Eagle file.

Return type:float
get_y2()[source]

Return the value of y2 for this Rectangle. This corresponds to the y2 attribute of a <rectangle> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_layer(v)[source]

Set the value of layer for this Rectangle. This corresponds to the layer attribute of a <rectangle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_rot(v)[source]

Set the value of rot for this Rectangle. This corresponds to the rot attribute of a <rectangle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x1(v)[source]

Set the value of x1 for this Rectangle. This corresponds to the x1 attribute of a <rectangle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x2(v)[source]

Set the value of x2 for this Rectangle. This corresponds to the x2 attribute of a <rectangle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y1(v)[source]

Set the value of y1 for this Rectangle. This corresponds to the y1 attribute of a <rectangle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y2(v)[source]

Set the value of y2 for this Rectangle. This corresponds to the y2 attribute of a <rectangle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_layer(v)[source]

Filter this EagleFilePart object based on the value of layer. For use in combination with From objects.

Return self if one of the following is true:

  1. layer equals v
  2. v is callable and v(self.get_layer() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_rot(v)[source]

Filter this EagleFilePart object based on the value of rot. For use in combination with From objects.

Return self if one of the following is true:

  1. rot equals v
  2. v is callable and v(self.get_rot() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x1(v)[source]

Filter this EagleFilePart object based on the value of x1. For use in combination with From objects.

Return self if one of the following is true:

  1. x1 equals v
  2. v is callable and v(self.get_x1() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x2(v)[source]

Filter this EagleFilePart object based on the value of x2. For use in combination with From objects.

Return self if one of the following is true:

  1. x2 equals v
  2. v is callable and v(self.get_x2() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y1(v)[source]

Filter this EagleFilePart object based on the value of y1. For use in combination with From objects.

Return self if one of the following is true:

  1. y1 equals v
  2. v is callable and v(self.get_y1() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y2(v)[source]

Filter this EagleFilePart object based on the value of y2. For use in combination with From objects.

Return self if one of the following is true:

  1. y2 equals v
  2. v is callable and v(self.get_y2() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Vertex

class Swoop.Vertex[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <vertex> tag in Eagle files.

Attributes:

  • x
  • y
  • curve
clone()[source]

Recursively clone this Vertex. It will be identical to the original, but it’s parent will be None.

Return type:Vertex
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_curve()[source]

Return the value of curve for this Vertex. This corresponds to the curve attribute of a <vertex> in an Eagle file.

Return type:float
get_et()[source]

Generate a <vertex> element tree for a Vertex.

Return type:ElementTree.
get_x()[source]

Return the value of x for this Vertex. This corresponds to the x attribute of a <vertex> in an Eagle file.

Return type:float
get_y()[source]

Return the value of y for this Vertex. This corresponds to the y attribute of a <vertex> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_curve(v)[source]

Set the value of curve for this Vertex. This corresponds to the curve attribute of a <vertex> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x(v)[source]

Set the value of x for this Vertex. This corresponds to the x attribute of a <vertex> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y(v)[source]

Set the value of y for this Vertex. This corresponds to the y attribute of a <vertex> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_curve(v)[source]

Filter this EagleFilePart object based on the value of curve. For use in combination with From objects.

Return self if one of the following is true:

  1. curve equals v
  2. v is callable and v(self.get_curve() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x(v)[source]

Filter this EagleFilePart object based on the value of x. For use in combination with From objects.

Return self if one of the following is true:

  1. x equals v
  2. v is callable and v(self.get_x() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y(v)[source]

Filter this EagleFilePart object based on the value of y. For use in combination with From objects.

Return self if one of the following is true:

  1. y equals v
  2. v is callable and v(self.get_y() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Circle

class Swoop.Circle[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <circle> tag in Eagle files.

Attributes:

  • x
  • y
  • radius
  • width
  • layer
clone()[source]

Recursively clone this Circle. It will be identical to the original, but it’s parent will be None.

Return type:Circle
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <circle> element tree for a Circle.

Return type:ElementTree.
get_layer()[source]

Return the value of layer for this Circle. This corresponds to the layer attribute of a <circle> in an Eagle file.

Return type:layer_string
get_radius()[source]

Return the value of radius for this Circle. This corresponds to the radius attribute of a <circle> in an Eagle file.

Return type:float
get_width()[source]

Return the value of width for this Circle. This corresponds to the width attribute of a <circle> in an Eagle file.

Return type:float
get_x()[source]

Return the value of x for this Circle. This corresponds to the x attribute of a <circle> in an Eagle file.

Return type:float
get_y()[source]

Return the value of y for this Circle. This corresponds to the y attribute of a <circle> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_layer(v)[source]

Set the value of layer for this Circle. This corresponds to the layer attribute of a <circle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_radius(v)[source]

Set the value of radius for this Circle. This corresponds to the radius attribute of a <circle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_width(v)[source]

Set the value of width for this Circle. This corresponds to the width attribute of a <circle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x(v)[source]

Set the value of x for this Circle. This corresponds to the x attribute of a <circle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y(v)[source]

Set the value of y for this Circle. This corresponds to the y attribute of a <circle> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_layer(v)[source]

Filter this EagleFilePart object based on the value of layer. For use in combination with From objects.

Return self if one of the following is true:

  1. layer equals v
  2. v is callable and v(self.get_layer() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_radius(v)[source]

Filter this EagleFilePart object based on the value of radius. For use in combination with From objects.

Return self if one of the following is true:

  1. radius equals v
  2. v is callable and v(self.get_radius() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_width(v)[source]

Filter this EagleFilePart object based on the value of width. For use in combination with From objects.

Return self if one of the following is true:

  1. width equals v
  2. v is callable and v(self.get_width() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x(v)[source]

Filter this EagleFilePart object based on the value of x. For use in combination with From objects.

Return self if one of the following is true:

  1. x equals v
  2. v is callable and v(self.get_x() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y(v)[source]

Filter this EagleFilePart object based on the value of y. For use in combination with From objects.

Return self if one of the following is true:

  1. y equals v
  2. v is callable and v(self.get_y() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Class

class Swoop.Class[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <class> tag in Eagle files.

Attributes:

  • number
  • name
  • width
  • drill

Collections:

  • clearance: Map of Clearance objects indexed by their netclass.
add_clearance(s)[source]

Add a Clearance to the clearances of this Class.

Parameters:s – The Clearance to add.
Return type:self
clear_clearances()[source]

Remove all the Clearance objects from the clearances of this Class.

Return type:self
clone()[source]

Recursively clone this Class. It will be identical to the original, but it’s parent will be None.

Return type:Class
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_clearance(key)[source]

Lookup and return a Clearance from the clearances of this Class.

Parameters:key – A str to use for the lookup. The lookup uses the netclass of the Clearance objects.
Return type:A Clearance object or None, if there is no such item.
get_clearances(attrs=None, type=None)[source]

Return (and possibly filter) items in the the clearances map of Clearance objects for this Class.

This functions provides a mechanism for filtering the items as well. The keys in attrs are taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.

A if type is not None, the item will match if it is an instance of the type provided.

Parameters:
  • attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
  • type – A type to filter on. Only items that are an instance of this type will be returned.
Returns:

A List of Clearance objects

Return type:

List of Clearance objects

get_drill()[source]

Return the value of drill for this Class. This corresponds to the drill attribute of a <class> in an Eagle file.

Return type:float
get_et()[source]

Generate a <class> element tree for a Class.

Return type:ElementTree.
get_name()[source]

Return the value of name for this Class. This corresponds to the name attribute of a <class> in an Eagle file.

Return type:str
get_nth_clearance(n)[source]

get then nth Clearance object from the clearances of this Class.

Parameters:n – Index of the item to return.
Return type:Clearance object
get_number()[source]

Return the value of number for this Class. This corresponds to the number attribute of a <class> in an Eagle file.

Return type:str
get_width()[source]

Return the value of width for this Class. This corresponds to the width attribute of a <class> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
remove_clearance(efp)[source]

Remove a Clearance from the clearances of this Class.

Parameters:efp – The Clearance object to remove.
Return type:self
set_drill(v)[source]

Set the value of drill for this Class. This corresponds to the drill attribute of a <class> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_name(v)[source]

Set the value of name for this Class. This corresponds to the name attribute of a <class> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_number(v)[source]

Set the value of number for this Class. This corresponds to the number attribute of a <class> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_width(v)[source]

Set the value of width for this Class. This corresponds to the width attribute of a <class> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_drill(v)[source]

Filter this EagleFilePart object based on the value of drill. For use in combination with From objects.

Return self if one of the following is true:

  1. drill equals v
  2. v is callable and v(self.get_drill() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_name(v)[source]

Filter this EagleFilePart object based on the value of name. For use in combination with From objects.

Return self if one of the following is true:

  1. name equals v
  2. v is callable and v(self.get_name() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_number(v)[source]

Filter this EagleFilePart object based on the value of number. For use in combination with From objects.

Return self if one of the following is true:

  1. number equals v
  2. v is callable and v(self.get_number() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_width(v)[source]

Filter this EagleFilePart object based on the value of width. For use in combination with From objects.

Return self if one of the following is true:

  1. width equals v
  2. v is callable and v(self.get_width() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Approved

class Swoop.Approved[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <approved> tag in Eagle files.

Attributes:

  • hash
clone()[source]

Recursively clone this Approved. It will be identical to the original, but it’s parent will be None.

Return type:Approved
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <approved> element tree for a Approved.

Return type:ElementTree.
get_hash()[source]

Return the value of hash for this Approved. This corresponds to the hash attribute of a <approved> in an Eagle file.

Return type:str
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_hash(v)[source]

Set the value of hash for this Approved. This corresponds to the hash attribute of a <approved> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_hash(v)[source]

Filter this EagleFilePart object based on the value of hash. For use in combination with From objects.

Return self if one of the following is true:

  1. hash equals v
  2. v is callable and v(self.get_hash() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Clearance

class Swoop.Clearance[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <clearance> tag in Eagle files.

Attributes:

  • class
  • value
clone()[source]

Recursively clone this Clearance. It will be identical to the original, but it’s parent will be None.

Return type:Clearance
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

find_class()[source]

Find the Class object refered to by the netclass attribute of this object. This is like get_netclass(), except it returns the Class object instead of its name.

Returns:The object
Return type:Class
get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_class()[source]

Return the value of netclass for this Clearance. This corresponds to the netclass attribute of a <clearance> in an Eagle file.

Return type:str
get_et()[source]

Generate a <clearance> element tree for a Clearance.

Return type:ElementTree.
get_value()[source]

Return the value of value for this Clearance. This corresponds to the value attribute of a <clearance> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_class(v)[source]

Set the value of netclass for this Clearance. This corresponds to the netclass attribute of a <clearance> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_value(v)[source]

Set the value of value for this Clearance. This corresponds to the value attribute of a <clearance> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_class(v)[source]

Filter this EagleFilePart object based on the value of netclass. For use in combination with From objects.

Return self if one of the following is true:

  1. netclass equals v
  2. v is callable and v(self.get_class() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_value(v)[source]

Filter this EagleFilePart object based on the value of value. For use in combination with From objects.

Return self if one of the following is true:

  1. value equals v
  2. v is callable and v(self.get_value() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Compatibility

class Swoop.Compatibility[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <compatibility> tag in Eagle files.

Attributes:

Collections:

  • note: List of Note objects.
add_note(s)[source]

Add a Note to the notes of this Compatibility.

Parameters:s – The Note to add.
Return type:self
clear_notes()[source]

Remove all the Note objects from the notes of this Compatibility.

Return type:self
clone()[source]

Recursively clone this Compatibility. It will be identical to the original, but it’s parent will be None.

Return type:Compatibility
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <compatibility> element tree for a Compatibility.

Return type:ElementTree.
get_notes(attrs=None, type=None)[source]

Return (and possibly filter) items in the the notes list of Note objects for this Compatibility.

This functions provides a mechanism for filtering the items as well. The keys in attrs are taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.

A if type is not None, the item will match if it is an instance of the type provided.

Parameters:
  • attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
  • type – A type to filter on. Only items that are an instance of this type will be returned.
Returns:

A List of Note objects

Return type:

List of Note objects

get_nth_note(n)[source]

get then nth Note object from the notes of this Compatibility.

Parameters:n – Index of the item to return.
Return type:Note object
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
remove_note(efp)[source]

Remove a Note from the notes of this Compatibility.

Parameters:efp – The Note object to remove.
Return type:self

Description

class Swoop.Description[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <description> tag in Eagle files.

Attributes:

  • language
clone()[source]

Recursively clone this Description. It will be identical to the original, but it’s parent will be None.

Return type:Description
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <description> element tree for a Description.

Return type:ElementTree.
get_language()[source]

Return the value of language for this Description. This corresponds to the language attribute of a <description> in an Eagle file.

Return type:str
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_language(v)[source]

Set the value of language for this Description. This corresponds to the language attribute of a <description> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_language(v)[source]

Filter this EagleFilePart object based on the value of language. For use in combination with From objects.

Return self if one of the following is true:

  1. language equals v
  2. v is callable and v(self.get_language() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_text(v)[source]

Filter this EagleFilePart object based on the value of text. For use in combination with From objects.

Return self if one of the following is true:

  1. text equals v
  2. v is callable and v(self.get_text() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Designrules

class Swoop.Designrules[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <designrules> tag in Eagle files.

Attributes:

  • name

Collections:

  • description: List of Description objects.
  • param: Map of Param objects indexed by their name.
add_description(s)[source]

Add a Description to the description of this Designrules.

Parameters:s – The Description to add.
Return type:self
add_param(s)[source]

Add a Param to the params of this Designrules.

Parameters:s – The Param to add.
Return type:self
clear_description()[source]

Remove all the Description objects from the description of this Designrules.

Return type:self
clear_params()[source]

Remove all the Param objects from the params of this Designrules.

Return type:self
clone()[source]

Recursively clone this Designrules. It will be identical to the original, but it’s parent will be None.

Return type:Designrules
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_description(attrs=None, type=None)[source]

Return (and possibly filter) items in the the description list of Description objects for this Designrules.

This functions provides a mechanism for filtering the items as well. The keys in attrs are taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.

A if type is not None, the item will match if it is an instance of the type provided.

Parameters:
  • attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
  • type – A type to filter on. Only items that are an instance of this type will be returned.
Returns:

A List of Description objects

Return type:

List of Description objects

get_et()[source]

Generate a <designrules> element tree for a Designrules.

Return type:ElementTree.
get_name()[source]

Return the value of name for this Designrules. This corresponds to the name attribute of a <designrules> in an Eagle file.

Return type:str
get_nth_description(n)[source]

get then nth Description object from the description of this Designrules.

Parameters:n – Index of the item to return.
Return type:Description object
get_nth_param(n)[source]

get then nth Param object from the params of this Designrules.

Parameters:n – Index of the item to return.
Return type:Param object
get_param(key)[source]

Lookup and return a Param from the params of this Designrules.

Parameters:key – A str to use for the lookup. The lookup uses the name of the Param objects.
Return type:A Param object or None, if there is no such item.
get_params(attrs=None, type=None)[source]

Return (and possibly filter) items in the the params map of Param objects for this Designrules.

This functions provides a mechanism for filtering the items as well. The keys in attrs are taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.

A if type is not None, the item will match if it is an instance of the type provided.

Parameters:
  • attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
  • type – A type to filter on. Only items that are an instance of this type will be returned.
Returns:

A List of Param objects

Return type:

List of Param objects

remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
remove_description(efp)[source]

Remove a Description from the description of this Designrules.

Parameters:efp – The Description object to remove.
Return type:self
remove_param(efp)[source]

Remove a Param from the params of this Designrules.

Parameters:efp – The Param object to remove.
Return type:self
set_name(v)[source]

Set the value of name for this Designrules. This corresponds to the name attribute of a <designrules> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_name(v)[source]

Filter this EagleFilePart object based on the value of name. For use in combination with From objects.

Return self if one of the following is true:

  1. name equals v
  2. v is callable and v(self.get_name() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Dimension

class Swoop.Dimension[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <dimension> tag in Eagle files.

Attributes:

  • x1
  • y1
  • x2
  • y2
  • x3
  • y3
  • layer
  • dtype
  • width
  • extwidth
  • extlength
  • extoffset
  • textsize
  • textratio
  • unit
  • precision
  • visible
clone()[source]

Recursively clone this Dimension. It will be identical to the original, but it’s parent will be None.

Return type:Dimension
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_dtype()[source]

Return the value of dtype for this Dimension. This corresponds to the dtype attribute of a <dimension> in an Eagle file.

Return type:str
get_et()[source]

Generate a <dimension> element tree for a Dimension.

Return type:ElementTree.
get_extlength()[source]

Return the value of extlength for this Dimension. This corresponds to the extlength attribute of a <dimension> in an Eagle file.

Return type:float
get_extoffset()[source]

Return the value of extoffset for this Dimension. This corresponds to the extoffset attribute of a <dimension> in an Eagle file.

Return type:float
get_extwidth()[source]

Return the value of extwidth for this Dimension. This corresponds to the extwidth attribute of a <dimension> in an Eagle file.

Return type:float
get_layer()[source]

Return the value of layer for this Dimension. This corresponds to the layer attribute of a <dimension> in an Eagle file.

Return type:layer_string
get_precision()[source]

Return the value of precision for this Dimension. This corresponds to the precision attribute of a <dimension> in an Eagle file.

Return type:int
get_textratio()[source]

Return the value of textratio for this Dimension. This corresponds to the textratio attribute of a <dimension> in an Eagle file.

Return type:int
get_textsize()[source]

Return the value of textsize for this Dimension. This corresponds to the textsize attribute of a <dimension> in an Eagle file.

Return type:float
get_unit()[source]

Return the value of unit for this Dimension. This corresponds to the unit attribute of a <dimension> in an Eagle file.

Return type:str
get_visible()[source]

Return the value of visible for this Dimension. This corresponds to the visible attribute of a <dimension> in an Eagle file.

Return type:bool
get_width()[source]

Return the value of width for this Dimension. This corresponds to the width attribute of a <dimension> in an Eagle file.

Return type:float
get_x1()[source]

Return the value of x1 for this Dimension. This corresponds to the x1 attribute of a <dimension> in an Eagle file.

Return type:float
get_x2()[source]

Return the value of x2 for this Dimension. This corresponds to the x2 attribute of a <dimension> in an Eagle file.

Return type:float
get_x3()[source]

Return the value of x3 for this Dimension. This corresponds to the x3 attribute of a <dimension> in an Eagle file.

Return type:float
get_y1()[source]

Return the value of y1 for this Dimension. This corresponds to the y1 attribute of a <dimension> in an Eagle file.

Return type:float
get_y2()[source]

Return the value of y2 for this Dimension. This corresponds to the y2 attribute of a <dimension> in an Eagle file.

Return type:float
get_y3()[source]

Return the value of y3 for this Dimension. This corresponds to the y3 attribute of a <dimension> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_dtype(v)[source]

Set the value of dtype for this Dimension. This corresponds to the dtype attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_extlength(v)[source]

Set the value of extlength for this Dimension. This corresponds to the extlength attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_extoffset(v)[source]

Set the value of extoffset for this Dimension. This corresponds to the extoffset attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_extwidth(v)[source]

Set the value of extwidth for this Dimension. This corresponds to the extwidth attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_layer(v)[source]

Set the value of layer for this Dimension. This corresponds to the layer attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_precision(v)[source]

Set the value of precision for this Dimension. This corresponds to the precision attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_textratio(v)[source]

Set the value of textratio for this Dimension. This corresponds to the textratio attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_textsize(v)[source]

Set the value of textsize for this Dimension. This corresponds to the textsize attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_unit(v)[source]

Set the value of unit for this Dimension. This corresponds to the unit attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_visible(v)[source]

Set the value of visible for this Dimension. This corresponds to the visible attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_width(v)[source]

Set the value of width for this Dimension. This corresponds to the width attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x1(v)[source]

Set the value of x1 for this Dimension. This corresponds to the x1 attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x2(v)[source]

Set the value of x2 for this Dimension. This corresponds to the x2 attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x3(v)[source]

Set the value of x3 for this Dimension. This corresponds to the x3 attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y1(v)[source]

Set the value of y1 for this Dimension. This corresponds to the y1 attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y2(v)[source]

Set the value of y2 for this Dimension. This corresponds to the y2 attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y3(v)[source]

Set the value of y3 for this Dimension. This corresponds to the y3 attribute of a <dimension> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_dtype(v)[source]

Filter this EagleFilePart object based on the value of dtype. For use in combination with From objects.

Return self if one of the following is true:

  1. dtype equals v
  2. v is callable and v(self.get_dtype() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_extlength(v)[source]

Filter this EagleFilePart object based on the value of extlength. For use in combination with From objects.

Return self if one of the following is true:

  1. extlength equals v
  2. v is callable and v(self.get_extlength() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_extoffset(v)[source]

Filter this EagleFilePart object based on the value of extoffset. For use in combination with From objects.

Return self if one of the following is true:

  1. extoffset equals v
  2. v is callable and v(self.get_extoffset() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_extwidth(v)[source]

Filter this EagleFilePart object based on the value of extwidth. For use in combination with From objects.

Return self if one of the following is true:

  1. extwidth equals v
  2. v is callable and v(self.get_extwidth() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_layer(v)[source]

Filter this EagleFilePart object based on the value of layer. For use in combination with From objects.

Return self if one of the following is true:

  1. layer equals v
  2. v is callable and v(self.get_layer() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_precision(v)[source]

Filter this EagleFilePart object based on the value of precision. For use in combination with From objects.

Return self if one of the following is true:

  1. precision equals v
  2. v is callable and v(self.get_precision() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_textratio(v)[source]

Filter this EagleFilePart object based on the value of textratio. For use in combination with From objects.

Return self if one of the following is true:

  1. textratio equals v
  2. v is callable and v(self.get_textratio() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_textsize(v)[source]

Filter this EagleFilePart object based on the value of textsize. For use in combination with From objects.

Return self if one of the following is true:

  1. textsize equals v
  2. v is callable and v(self.get_textsize() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_unit(v)[source]

Filter this EagleFilePart object based on the value of unit. For use in combination with From objects.

Return self if one of the following is true:

  1. unit equals v
  2. v is callable and v(self.get_unit() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_visible(v)[source]

Filter this EagleFilePart object based on the value of visible. For use in combination with From objects.

Return self if one of the following is true:

  1. visible equals v
  2. v is callable and v(self.get_visible() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_width(v)[source]

Filter this EagleFilePart object based on the value of width. For use in combination with From objects.

Return self if one of the following is true:

  1. width equals v
  2. v is callable and v(self.get_width() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x1(v)[source]

Filter this EagleFilePart object based on the value of x1. For use in combination with From objects.

Return self if one of the following is true:

  1. x1 equals v
  2. v is callable and v(self.get_x1() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x2(v)[source]

Filter this EagleFilePart object based on the value of x2. For use in combination with From objects.

Return self if one of the following is true:

  1. x2 equals v
  2. v is callable and v(self.get_x2() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x3(v)[source]

Filter this EagleFilePart object based on the value of x3. For use in combination with From objects.

Return self if one of the following is true:

  1. x3 equals v
  2. v is callable and v(self.get_x3() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y1(v)[source]

Filter this EagleFilePart object based on the value of y1. For use in combination with From objects.

Return self if one of the following is true:

  1. y1 equals v
  2. v is callable and v(self.get_y1() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y2(v)[source]

Filter this EagleFilePart object based on the value of y2. For use in combination with From objects.

Return self if one of the following is true:

  1. y2 equals v
  2. v is callable and v(self.get_y2() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y3(v)[source]

Filter this EagleFilePart object based on the value of y3. For use in combination with From objects.

Return self if one of the following is true:

  1. y3 equals v
  2. v is callable and v(self.get_y3() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Grid

class Swoop.Grid[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <grid> tag in Eagle files.

Attributes:

  • distance
  • unitdist
  • unit
  • style
  • multiple
  • display
  • altdistance
  • altunitdist
  • altunit
clone()[source]

Recursively clone this Grid. It will be identical to the original, but it’s parent will be None.

Return type:Grid
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_altdistance()[source]

Return the value of altdistance for this Grid. This corresponds to the altdistance attribute of a <grid> in an Eagle file.

Return type:float
get_altunit()[source]

Return the value of altunit for this Grid. This corresponds to the altunit attribute of a <grid> in an Eagle file.

Return type:str
get_altunitdist()[source]

Return the value of altunitdist for this Grid. This corresponds to the altunitdist attribute of a <grid> in an Eagle file.

Return type:str
get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_display()[source]

Return the value of display for this Grid. This corresponds to the display attribute of a <grid> in an Eagle file.

Return type:bool
get_distance()[source]

Return the value of distance for this Grid. This corresponds to the distance attribute of a <grid> in an Eagle file.

Return type:float
get_et()[source]

Generate a <grid> element tree for a Grid.

Return type:ElementTree.
get_multiple()[source]

Return the value of multiple for this Grid. This corresponds to the multiple attribute of a <grid> in an Eagle file.

Return type:int
get_style()[source]

Return the value of style for this Grid. This corresponds to the style attribute of a <grid> in an Eagle file.

Return type:str
get_unit()[source]

Return the value of unit for this Grid. This corresponds to the unit attribute of a <grid> in an Eagle file.

Return type:str
get_unitdist()[source]

Return the value of unitdist for this Grid. This corresponds to the unitdist attribute of a <grid> in an Eagle file.

Return type:str
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_altdistance(v)[source]

Set the value of altdistance for this Grid. This corresponds to the altdistance attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_altunit(v)[source]

Set the value of altunit for this Grid. This corresponds to the altunit attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_altunitdist(v)[source]

Set the value of altunitdist for this Grid. This corresponds to the altunitdist attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_display(v)[source]

Set the value of display for this Grid. This corresponds to the display attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_distance(v)[source]

Set the value of distance for this Grid. This corresponds to the distance attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_multiple(v)[source]

Set the value of multiple for this Grid. This corresponds to the multiple attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_style(v)[source]

Set the value of style for this Grid. This corresponds to the style attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_unit(v)[source]

Set the value of unit for this Grid. This corresponds to the unit attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_unitdist(v)[source]

Set the value of unitdist for this Grid. This corresponds to the unitdist attribute of a <grid> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_altdistance(v)[source]

Filter this EagleFilePart object based on the value of altdistance. For use in combination with From objects.

Return self if one of the following is true:

  1. altdistance equals v
  2. v is callable and v(self.get_altdistance() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_altunit(v)[source]

Filter this EagleFilePart object based on the value of altunit. For use in combination with From objects.

Return self if one of the following is true:

  1. altunit equals v
  2. v is callable and v(self.get_altunit() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_altunitdist(v)[source]

Filter this EagleFilePart object based on the value of altunitdist. For use in combination with From objects.

Return self if one of the following is true:

  1. altunitdist equals v
  2. v is callable and v(self.get_altunitdist() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_display(v)[source]

Filter this EagleFilePart object based on the value of display. For use in combination with From objects.

Return self if one of the following is true:

  1. display equals v
  2. v is callable and v(self.get_display() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_distance(v)[source]

Filter this EagleFilePart object based on the value of distance. For use in combination with From objects.

Return self if one of the following is true:

  1. distance equals v
  2. v is callable and v(self.get_distance() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_multiple(v)[source]

Filter this EagleFilePart object based on the value of multiple. For use in combination with From objects.

Return self if one of the following is true:

  1. multiple equals v
  2. v is callable and v(self.get_multiple() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_style(v)[source]

Filter this EagleFilePart object based on the value of style. For use in combination with From objects.

Return self if one of the following is true:

  1. style equals v
  2. v is callable and v(self.get_style() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_unit(v)[source]

Filter this EagleFilePart object based on the value of unit. For use in combination with From objects.

Return self if one of the following is true:

  1. unit equals v
  2. v is callable and v(self.get_unit() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_unitdist(v)[source]

Filter this EagleFilePart object based on the value of unitdist. For use in combination with From objects.

Return self if one of the following is true:

  1. unitdist equals v
  2. v is callable and v(self.get_unitdist() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Hole

class Swoop.Hole[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <hole> tag in Eagle files.

Attributes:

  • x
  • y
  • drill
clone()[source]

Recursively clone this Hole. It will be identical to the original, but it’s parent will be None.

Return type:Hole
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_drill()[source]

Return the value of drill for this Hole. This corresponds to the drill attribute of a <hole> in an Eagle file.

Return type:float
get_et()[source]

Generate a <hole> element tree for a Hole.

Return type:ElementTree.
get_x()[source]

Return the value of x for this Hole. This corresponds to the x attribute of a <hole> in an Eagle file.

Return type:float
get_y()[source]

Return the value of y for this Hole. This corresponds to the y attribute of a <hole> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_drill(v)[source]

Set the value of drill for this Hole. This corresponds to the drill attribute of a <hole> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x(v)[source]

Set the value of x for this Hole. This corresponds to the x attribute of a <hole> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y(v)[source]

Set the value of y for this Hole. This corresponds to the y attribute of a <hole> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_drill(v)[source]

Filter this EagleFilePart object based on the value of drill. For use in combination with From objects.

Return self if one of the following is true:

  1. drill equals v
  2. v is callable and v(self.get_drill() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x(v)[source]

Filter this EagleFilePart object based on the value of x. For use in combination with From objects.

Return self if one of the following is true:

  1. x equals v
  2. v is callable and v(self.get_x() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y(v)[source]

Filter this EagleFilePart object based on the value of y. For use in combination with From objects.

Return self if one of the following is true:

  1. y equals v
  2. v is callable and v(self.get_y() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Label

class Swoop.Label[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <label> tag in Eagle files.

Attributes:

  • x
  • y
  • size
  • layer
  • font
  • ratio
  • rot
  • xref
clone()[source]

Recursively clone this Label. It will be identical to the original, but it’s parent will be None.

Return type:Label
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <label> element tree for a Label.

Return type:ElementTree.
get_font()[source]

Return the value of font for this Label. This corresponds to the font attribute of a <label> in an Eagle file.

Return type:str
get_layer()[source]

Return the value of layer for this Label. This corresponds to the layer attribute of a <label> in an Eagle file.

Return type:layer_string
get_ratio()[source]

Return the value of ratio for this Label. This corresponds to the ratio attribute of a <label> in an Eagle file.

Return type:int
get_rot()[source]

Return the value of rot for this Label. This corresponds to the rot attribute of a <label> in an Eagle file.

Return type:str
get_size()[source]

Return the value of size for this Label. This corresponds to the size attribute of a <label> in an Eagle file.

Return type:float
get_x()[source]

Return the value of x for this Label. This corresponds to the x attribute of a <label> in an Eagle file.

Return type:float
get_xref()[source]

Return the value of xref for this Label. This corresponds to the xref attribute of a <label> in an Eagle file.

Return type:bool
get_y()[source]

Return the value of y for this Label. This corresponds to the y attribute of a <label> in an Eagle file.

Return type:float
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_font(v)[source]

Set the value of font for this Label. This corresponds to the font attribute of a <label> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_layer(v)[source]

Set the value of layer for this Label. This corresponds to the layer attribute of a <label> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_ratio(v)[source]

Set the value of ratio for this Label. This corresponds to the ratio attribute of a <label> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_rot(v)[source]

Set the value of rot for this Label. This corresponds to the rot attribute of a <label> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_size(v)[source]

Set the value of size for this Label. This corresponds to the size attribute of a <label> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_x(v)[source]

Set the value of x for this Label. This corresponds to the x attribute of a <label> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_xref(v)[source]

Set the value of xref for this Label. This corresponds to the xref attribute of a <label> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_y(v)[source]

Set the value of y for this Label. This corresponds to the y attribute of a <label> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_font(v)[source]

Filter this EagleFilePart object based on the value of font. For use in combination with From objects.

Return self if one of the following is true:

  1. font equals v
  2. v is callable and v(self.get_font() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_layer(v)[source]

Filter this EagleFilePart object based on the value of layer. For use in combination with From objects.

Return self if one of the following is true:

  1. layer equals v
  2. v is callable and v(self.get_layer() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_ratio(v)[source]

Filter this EagleFilePart object based on the value of ratio. For use in combination with From objects.

Return self if one of the following is true:

  1. ratio equals v
  2. v is callable and v(self.get_ratio() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_rot(v)[source]

Filter this EagleFilePart object based on the value of rot. For use in combination with From objects.

Return self if one of the following is true:

  1. rot equals v
  2. v is callable and v(self.get_rot() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_size(v)[source]

Filter this EagleFilePart object based on the value of size. For use in combination with From objects.

Return self if one of the following is true:

  1. size equals v
  2. v is callable and v(self.get_size() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_x(v)[source]

Filter this EagleFilePart object based on the value of x. For use in combination with From objects.

Return self if one of the following is true:

  1. x equals v
  2. v is callable and v(self.get_x() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_xref(v)[source]

Filter this EagleFilePart object based on the value of xref. For use in combination with From objects.

Return self if one of the following is true:

  1. xref equals v
  2. v is callable and v(self.get_xref() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_y(v)[source]

Filter this EagleFilePart object based on the value of y. For use in combination with From objects.

Return self if one of the following is true:

  1. y equals v
  2. v is callable and v(self.get_y() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Note

class Swoop.Note[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <note> tag in Eagle files.

Attributes:

  • minversion
  • version
  • severity
clone()[source]

Recursively clone this Note. It will be identical to the original, but it’s parent will be None.

Return type:Note
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <note> element tree for a Note.

Return type:ElementTree.
get_minversion()[source]

Return the value of minversion for this Note. This corresponds to the minversion attribute of a <note> in an Eagle file.

Return type:str
get_severity()[source]

Return the value of severity for this Note. This corresponds to the severity attribute of a <note> in an Eagle file.

Return type:str
get_version()[source]

Return the value of version for this Note. This corresponds to the version attribute of a <note> in an Eagle file.

Return type:str
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_minversion(v)[source]

Set the value of minversion for this Note. This corresponds to the minversion attribute of a <note> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_severity(v)[source]

Set the value of severity for this Note. This corresponds to the severity attribute of a <note> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_version(v)[source]

Set the value of version for this Note. This corresponds to the version attribute of a <note> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_minversion(v)[source]

Filter this EagleFilePart object based on the value of minversion. For use in combination with From objects.

Return self if one of the following is true:

  1. minversion equals v
  2. v is callable and v(self.get_minversion() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_severity(v)[source]

Filter this EagleFilePart object based on the value of severity. For use in combination with From objects.

Return self if one of the following is true:

  1. severity equals v
  2. v is callable and v(self.get_severity() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_text(v)[source]

Filter this EagleFilePart object based on the value of text. For use in combination with From objects.

Return self if one of the following is true:

  1. text equals v
  2. v is callable and v(self.get_text() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_version(v)[source]

Filter this EagleFilePart object based on the value of version. For use in combination with From objects.

Return self if one of the following is true:

  1. version equals v
  2. v is callable and v(self.get_version() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Param

class Swoop.Param[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <param> tag in Eagle files.

Attributes:

  • name
  • value
clone()[source]

Recursively clone this Param. It will be identical to the original, but it’s parent will be None.

Return type:Param
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <param> element tree for a Param.

Return type:ElementTree.
get_name()[source]

Return the value of name for this Param. This corresponds to the name attribute of a <param> in an Eagle file.

Return type:str
get_value()[source]

Return the value of value for this Param. This corresponds to the value attribute of a <param> in an Eagle file.

Return type:str
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_name(v)[source]

Set the value of name for this Param. This corresponds to the name attribute of a <param> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_value(v)[source]

Set the value of value for this Param. This corresponds to the value attribute of a <param> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_name(v)[source]

Filter this EagleFilePart object based on the value of name. For use in combination with From objects.

Return self if one of the following is true:

  1. name equals v
  2. v is callable and v(self.get_name() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_value(v)[source]

Filter this EagleFilePart object based on the value of value. For use in combination with From objects.

Return self if one of the following is true:

  1. value equals v
  2. v is callable and v(self.get_value() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Setting

class Swoop.Setting[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <setting> tag in Eagle files.

Attributes:

  • alwaysvectorfont
  • verticaltext
clone()[source]

Recursively clone this Setting. It will be identical to the original, but it’s parent will be None.

Return type:Setting
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_alwaysvectorfont()[source]

Return the value of alwaysvectorfont for this Setting. This corresponds to the alwaysvectorfont attribute of a <setting> in an Eagle file.

Return type:bool
get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <setting> element tree for a Setting.

Return type:ElementTree.
get_verticaltext()[source]

Return the value of verticaltext for this Setting. This corresponds to the verticaltext attribute of a <setting> in an Eagle file.

Return type:str
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_alwaysvectorfont(v)[source]

Set the value of alwaysvectorfont for this Setting. This corresponds to the alwaysvectorfont attribute of a <setting> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_verticaltext(v)[source]

Set the value of verticaltext for this Setting. This corresponds to the verticaltext attribute of a <setting> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_alwaysvectorfont(v)[source]

Filter this EagleFilePart object based on the value of alwaysvectorfont. For use in combination with From objects.

Return self if one of the following is true:

  1. alwaysvectorfont equals v
  2. v is callable and v(self.get_alwaysvectorfont() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_verticaltext(v)[source]

Filter this EagleFilePart object based on the value of verticaltext. For use in combination with From objects.

Return self if one of the following is true:

  1. verticaltext equals v
  2. v is callable and v(self.get_verticaltext() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Technology

class Swoop.Technology[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <technology> tag in Eagle files.

Attributes:

  • name

Collections:

  • attribute: Map of Attribute objects indexed by their name.
add_attribute(s)[source]

Add a Attribute to the attributes of this Technology.

Parameters:s – The Attribute to add.
Return type:self
clear_attributes()[source]

Remove all the Attribute objects from the attributes of this Technology.

Return type:self
clone()[source]

Recursively clone this Technology. It will be identical to the original, but it’s parent will be None.

Return type:Technology
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_attribute(key)[source]

Lookup and return a Attribute from the attributes of this Technology.

Parameters:key – A str to use for the lookup. The lookup uses the name of the Attribute objects.
Return type:A Attribute object or None, if there is no such item.
get_attributes(attrs=None, type=None)[source]

Return (and possibly filter) items in the the attributes map of Attribute objects for this Technology.

This functions provides a mechanism for filtering the items as well. The keys in attrs are taken as attributes names and the values are requested values. Items in the list that have all the requested values for the corresponding attributes will be returned.

A if type is not None, the item will match if it is an instance of the type provided.

Parameters:
  • attrs – A set of key-value pairs that represent a filter to apply to the item’s attributes.
  • type – A type to filter on. Only items that are an instance of this type will be returned.
Returns:

A List of Attribute objects

Return type:

List of Attribute objects

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <technology> element tree for a Technology.

Return type:ElementTree.
get_name()[source]

Return the value of name for this Technology. This corresponds to the name attribute of a <technology> in an Eagle file.

Return type:str
get_nth_attribute(n)[source]

get then nth Attribute object from the attributes of this Technology.

Parameters:n – Index of the item to return.
Return type:Attribute object
remove_attribute(efp)[source]

Remove a Attribute from the attributes of this Technology.

Parameters:efp – The Attribute object to remove.
Return type:self
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_name(v)[source]

Set the value of name for this Technology. This corresponds to the name attribute of a <technology> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_name(v)[source]

Filter this EagleFilePart object based on the value of name. For use in combination with From objects.

Return self if one of the following is true:

  1. name equals v
  2. v is callable and v(self.get_name() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Variant

class Swoop.Variant[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <variant> tag in Eagle files.

Attributes:

  • name
  • populate
  • value
  • technology
clone()[source]

Recursively clone this Variant. It will be identical to the original, but it’s parent will be None.

Return type:Variant
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_et()[source]

Generate a <variant> element tree for a Variant.

Return type:ElementTree.
get_name()[source]

Return the value of name for this Variant. This corresponds to the name attribute of a <variant> in an Eagle file.

Return type:str
get_populate()[source]

Return the value of populate for this Variant. This corresponds to the populate attribute of a <variant> in an Eagle file.

Return type:bool
get_technology()[source]

Return the value of technology for this Variant. This corresponds to the technology attribute of a <variant> in an Eagle file.

Return type:str
get_value()[source]

Return the value of value for this Variant. This corresponds to the value attribute of a <variant> in an Eagle file.

Return type:str
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_name(v)[source]

Set the value of name for this Variant. This corresponds to the name attribute of a <variant> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_populate(v)[source]

Set the value of populate for this Variant. This corresponds to the populate attribute of a <variant> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_technology(v)[source]

Set the value of technology for this Variant. This corresponds to the technology attribute of a <variant> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_value(v)[source]

Set the value of value for this Variant. This corresponds to the value attribute of a <variant> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_name(v)[source]

Filter this EagleFilePart object based on the value of name. For use in combination with From objects.

Return self if one of the following is true:

  1. name equals v
  2. v is callable and v(self.get_name() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_populate(v)[source]

Filter this EagleFilePart object based on the value of populate. For use in combination with From objects.

Return self if one of the following is true:

  1. populate equals v
  2. v is callable and v(self.get_populate() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_technology(v)[source]

Filter this EagleFilePart object based on the value of technology. For use in combination with From objects.

Return self if one of the following is true:

  1. technology equals v
  2. v is callable and v(self.get_technology() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_value(v)[source]

Filter this EagleFilePart object based on the value of value. For use in combination with From objects.

Return self if one of the following is true:

  1. value equals v
  2. v is callable and v(self.get_value() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None

Variantdef

class Swoop.Variantdef[source]

Bases: Swoop.Swoop.EagleFilePart

Class representing the contents of a <variantdef> tag in Eagle files.

Attributes:

  • name
  • current
clone()[source]

Recursively clone this Variantdef. It will be identical to the original, but it’s parent will be None.

Return type:Variantdef
dump(indent='', increment=' ')[source]

Recursive debug dump.

Parameters:
  • indent – Indentation string. The output will be indented by this much.
  • increment – This will be appendeded to indent on recursive invocations.
Return type:

None

get_children()[source]

Get all the children of this EagleFilePart.

Return type:List of EagleFilePart objects
get_current()[source]

Return the value of current for this Variantdef. This corresponds to the current attribute of a <variantdef> in an Eagle file.

Return type:bool
get_et()[source]

Generate a <variantdef> element tree for a Variantdef.

Return type:ElementTree.
get_name()[source]

Return the value of name for this Variantdef. This corresponds to the name attribute of a <variantdef> in an Eagle file.

Return type:str
remove_child(efp)[source]

Remove a child EagleFilePart object.

Parameters:efp – the class:EagleFilePart object to remove.
Returns:Nothing
set_current(v)[source]

Set the value of current for this Variantdef. This corresponds to the current attribute of a <variantdef> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
set_name(v)[source]

Set the value of name for this Variantdef. This corresponds to the name attribute of a <variantdef> in an Eagle file.

Parameters:vEagleFilePart to set.
Return type:self
with_current(v)[source]

Filter this EagleFilePart object based on the value of current. For use in combination with From objects.

Return self if one of the following is true:

  1. current equals v
  2. v is callable and v(self.get_current() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None
with_name(v)[source]

Filter this EagleFilePart object based on the value of name. For use in combination with From objects.

Return self if one of the following is true:

  1. name equals v
  2. v is callable and v(self.get_name() is True

This is useful in combination with From object.

Parameters:t – The value to check for or a callable object.
Returns:self if the criteria above are met and None otherwise.
Return type:EagelFilePart or None