Classes for Library Files (.lbr)

These classes are used only within Eagle library files (.lbr) and in the libraries that are included in both .sch and .brd files.

If you are new to Swoop and trying to understand how these data structures map onto items in Eagle, it is useful to know that DeviceSet corresponds to what the Eagle GUI calls a “Device” and Device corresponds to what the GUI calls a “Variant”

LibraryFile

class Swoop.Base_LibraryFile[source]

Bases: Swoop.Swoop.EagleFile

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

Attributes:

  • version

Collections:

  • grid: Singleton Grid object.
  • library: Singleton Library object.
  • compatibility: Singleton Compatibility object.
  • setting: List of Setting objects.
  • layer: Map of Layer objects indexed by their name.
add_setting(s)[source]

Add a Setting to the settings of this LibraryFile.

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

Remove all the Setting objects from the settings of this LibraryFile.

Return type:self
clone()[source]

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

Return type:LibraryFile
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_compatibility()[source]

Get the compatibility from this LibraryFile.

Return type:Compatibility object
get_et()[source]

Generate a <eagle> element tree for a LibraryFile.

Return type:ElementTree.
get_grid()[source]

Get the grid from this LibraryFile.

Return type:Grid object
get_library()[source]

Get the library from this LibraryFile.

Return type:Library object
get_nth_setting(n)[source]

get then nth Setting object from the settings of this LibraryFile.

Parameters:n – Index of the item to return.
Return type:Setting object
get_settings(attrs=None, type=None)[source]

Return (and possibly filter) items in the the settings list of Setting objects for this LibraryFile.

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 Setting objects

Return type:

List of Setting objects

get_version()[source]

Return the value of version for this LibraryFile. This corresponds to the version attribute of a <eagle> 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
remove_setting(efp)[source]

Remove a Setting from the settings of this LibraryFile.

Parameters:efp – The Setting object to remove.
Return type:self
set_compatibility(s)[source]

Set the Compatibility for this LibraryFile.

Parameters:sCompatibility to set.
Return type:self
set_grid(s)[source]

Set the Grid for this LibraryFile.

Parameters:sGrid to set.
Return type:self
set_library(s)[source]

Set the Library for this LibraryFile.

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

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

Parameters:vEagleFilePart to set.
Return type:self
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

Library

class Swoop.Library[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • name

Collections:

  • description: Singleton Description object.
  • package: Map of Package objects indexed by their name.
  • symbol: Map of Symbol objects indexed by their name.
  • deviceset: Map of Deviceset objects indexed by their name.
add_deviceset(s)[source]

Add a Deviceset to the devicesets of this Library.

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

Add a Package to the packages of this Library.

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

Add a Symbol to the symbols of this Library.

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

Remove all the Deviceset objects from the devicesets of this Library.

Return type:self
clear_packages()[source]

Remove all the Package objects from the packages of this Library.

Return type:self
clear_symbols()[source]

Remove all the Symbol objects from the symbols of this Library.

Return type:self
clone()[source]

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

Return type:Library
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()[source]

Get the description from this Library.

Return type:Description object
get_deviceset(key)[source]

Lookup and return a Deviceset from the devicesets of this Library.

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

Return (and possibly filter) items in the the devicesets map of Deviceset objects for this Library.

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 Deviceset objects

Return type:

List of Deviceset objects

get_et()[source]

Generate a <library> element tree for a Library.

Return type:ElementTree.
get_name()[source]

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

Return type:str
get_nth_deviceset(n)[source]

get then nth Deviceset object from the devicesets of this Library.

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

get then nth Package object from the packages of this Library.

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

get then nth Symbol object from the symbols of this Library.

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

Lookup and return a Package from the packages of this Library.

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

Return (and possibly filter) items in the the packages map of Package objects for this Library.

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 Package objects

Return type:

List of Package objects

get_symbol(key)[source]

Lookup and return a Symbol from the symbols of this Library.

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

Return (and possibly filter) items in the the symbols map of Symbol objects for this Library.

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 Symbol objects

Return type:

List of Symbol objects

remove_child(efp)[source]

Remove a child EagleFilePart object.

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

Remove a Deviceset from the devicesets of this Library.

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

Remove a Package from the packages of this Library.

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

Remove a Symbol from the symbols of this Library.

Parameters:efp – The Symbol object to remove.
Return type:self
set_description(s)[source]

Set the Description for this Library.

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

Set the value of name for this Library. This corresponds to the name attribute of a <library> 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

Package

class Swoop.Package[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • name

Collections:

add_drawing_element(s)[source]

Add a Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole or Frame to the drawing_elements of this Package.

Parameters:s – The Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole or Frame to add.
Return type:self
add_pad(s)[source]

Add a Pad to the pads of this Package.

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

Add a Smd to the smds of this Package.

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

Remove all the Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole and Frame objects from the drawing_elements of this Package.

Return type:self
clear_pads()[source]

Remove all the Pad objects from the pads of this Package.

Return type:self
clear_smds()[source]

Remove all the Smd objects from the smds of this Package.

Return type:self
clone()[source]

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

Return type:Package
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()[source]

Get the description from this Package.

Return type:Description object
get_drawing_elements(attrs=None, type=None)[source]

Return (and possibly filter) items in the the drawing_elements list of Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole or Frame objects for this Package.

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 Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole and Frame objects

Return type:

List of Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole and Frame objects

get_et()[source]

Generate a <package> element tree for a Package.

Return type:ElementTree.
get_name()[source]

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

Return type:str
get_nth_drawing_element(n)[source]

get then nth Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole or Frame object from the drawing_elements of this Package.

Parameters:n – Index of the item to return.
Return type:Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole or Frame object
get_nth_pad(n)[source]

get then nth Pad object from the pads of this Package.

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

get then nth Smd object from the smds of this Package.

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

Lookup and return a Pad from the pads of this Package.

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

Return (and possibly filter) items in the the pads map of Pad objects for this Package.

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 Pad objects

Return type:

List of Pad objects

get_smd(key)[source]

Lookup and return a Smd from the smds of this Package.

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

Return (and possibly filter) items in the the smds map of Smd objects for this Package.

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 Smd objects

Return type:

List of Smd objects

remove_child(efp)[source]

Remove a child EagleFilePart object.

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

Remove a Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole or Frame from the drawing_elements of this Package.

Parameters:efp – The Polygon, Wire, Text, Dimension, Circle, Rectangle, Hole or Frame object to remove.
Return type:self
remove_pad(efp)[source]

Remove a Pad from the pads of this Package.

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

Remove a Smd from the smds of this Package.

Parameters:efp – The Smd object to remove.
Return type:self
set_description(s)[source]

Set the Description for this Package.

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

Set the value of name for this Package. This corresponds to the name attribute of a <package> 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

Symbol

class Swoop.Symbol[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • name

Collections:

add_drawing_element(s)[source]

Add a Polygon, Wire, Text, Dimension, Circle, Rectangle or Hole to the drawing_elements of this Symbol.

Parameters:s – The Polygon, Wire, Text, Dimension, Circle, Rectangle or Hole to add.
Return type:self
add_pin(s)[source]

Add a Pin to the pins of this Symbol.

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

Remove all the Polygon, Wire, Text, Dimension, Circle, Rectangle and Hole objects from the drawing_elements of this Symbol.

Return type:self
clear_pins()[source]

Remove all the Pin objects from the pins of this Symbol.

Return type:self
clone()[source]

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

Return type:Symbol
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()[source]

Get the description from this Symbol.

Return type:Description object
get_drawing_elements(attrs=None, type=None)[source]

Return (and possibly filter) items in the the drawing_elements list of Polygon, Wire, Text, Dimension, Circle, Rectangle or Hole objects for this Symbol.

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 Polygon, Wire, Text, Dimension, Circle, Rectangle and Hole objects

Return type:

List of Polygon, Wire, Text, Dimension, Circle, Rectangle and Hole objects

get_et()[source]

Generate a <symbol> element tree for a Symbol.

Return type:ElementTree.
get_name()[source]

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

Return type:str
get_nth_drawing_element(n)[source]

get then nth Polygon, Wire, Text, Dimension, Circle, Rectangle or Hole object from the drawing_elements of this Symbol.

Parameters:n – Index of the item to return.
Return type:Polygon, Wire, Text, Dimension, Circle, Rectangle or Hole object
get_nth_pin(n)[source]

get then nth Pin object from the pins of this Symbol.

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

Lookup and return a Pin from the pins of this Symbol.

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

Return (and possibly filter) items in the the pins map of Pin objects for this Symbol.

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 Pin objects

Return type:

List of Pin objects

remove_child(efp)[source]

Remove a child EagleFilePart object.

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

Remove a Polygon, Wire, Text, Dimension, Circle, Rectangle or Hole from the drawing_elements of this Symbol.

Parameters:efp – The Polygon, Wire, Text, Dimension, Circle, Rectangle or Hole object to remove.
Return type:self
remove_pin(efp)[source]

Remove a Pin from the pins of this Symbol.

Parameters:efp – The Pin object to remove.
Return type:self
set_description(s)[source]

Set the Description for this Symbol.

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

Set the value of name for this Symbol. This corresponds to the name attribute of a <symbol> 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

Deviceset

class Swoop.Deviceset[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • name
  • prefix
  • uservalue

Collections:

  • description: Singleton Description object.
  • gate: Map of Gate objects indexed by their name.
  • device: Map of Device objects indexed by their name.
add_device(s)[source]

Add a Device to the devices of this Deviceset.

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

Add a Gate to the gates of this Deviceset.

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

Remove all the Device objects from the devices of this Deviceset.

Return type:self
clear_gates()[source]

Remove all the Gate objects from the gates of this Deviceset.

Return type:self
clone()[source]

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

Return type:Deviceset
convertToExternal()

This converts the Deviceset into an external deviceset. This means that it has no associated package. It can, however, have attributes, and those are stored in the “” device. You can’t just delete all the packages, since you’d lose the attributes. This copies them from the first package.

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()[source]

Get the description from this Deviceset.

Return type:Description object
get_device(key)[source]

Lookup and return a Device from the devices of this Deviceset.

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

Return (and possibly filter) items in the the devices map of Device objects for this Deviceset.

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 Device objects

Return type:

List of Device objects

get_et()[source]

Generate a <deviceset> element tree for a Deviceset.

Return type:ElementTree.
get_gate(key)[source]

Lookup and return a Gate from the gates of this Deviceset.

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

Return (and possibly filter) items in the the gates map of Gate objects for this Deviceset.

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 Gate objects

Return type:

List of Gate objects

get_name()[source]

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

Return type:str
get_nth_device(n)[source]

get then nth Device object from the devices of this Deviceset.

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

get then nth Gate object from the gates of this Deviceset.

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

Return the value of prefix for this Deviceset. This corresponds to the prefix attribute of a <deviceset> in an Eagle file.

Return type:str
get_uservalue()[source]

Return the value of uservalue for this Deviceset. This corresponds to the uservalue attribute of a <deviceset> in an Eagle file.

Return type:bool
remove_child(efp)[source]

Remove a child EagleFilePart object.

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

Remove a Device from the devices of this Deviceset.

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

Remove a Gate from the gates of this Deviceset.

Parameters:efp – The Gate object to remove.
Return type:self
set_description(s)[source]

Set the Description for this Deviceset.

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

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

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

Set the value of prefix for this Deviceset. This corresponds to the prefix attribute of a <deviceset> in an Eagle file.

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

Set the value of uservalue for this Deviceset. This corresponds to the uservalue attribute of a <deviceset> 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_prefix(v)[source]

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

Return self if one of the following is true:

  1. prefix equals v
  2. v is callable and v(self.get_prefix() 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_uservalue(v)[source]

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

Return self if one of the following is true:

  1. uservalue equals v
  2. v is callable and v(self.get_uservalue() 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

Device

class Swoop.Device[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • name
  • package

Collections:

  • connect: List of Connect objects.
  • technology: Map of Technology objects indexed by their name.
add_connect(s)[source]

Add a Connect to the connects of this Device.

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

Add a Technology to the technologies of this Device.

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

Remove all the Connect objects from the connects of this Device.

Return type:self
clear_technologies()[source]

Remove all the Technology objects from the technologies of this Device.

Return type:self
clone()[source]

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

Return type:Device
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_package()[source]

Find the Package object refered to by the package attribute of this object. This is like get_package(), except it returns the Package object instead of its name.

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

Get all the children of this EagleFilePart.

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

Return (and possibly filter) items in the the connects list of Connect objects for this Device.

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 Connect objects

Return type:

List of Connect objects

get_et()[source]

Generate a <device> element tree for a Device.

Return type:ElementTree.
get_name()[source]

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

Return type:str
get_nth_connect(n)[source]

get then nth Connect object from the connects of this Device.

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

get then nth Technology object from the technologies of this Device.

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

Return the value of package for this Device. This corresponds to the package attribute of a <device> in an Eagle file.

Return type:str
get_technologies(attrs=None, type=None)[source]

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

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 Technology objects

Return type:

List of Technology objects

get_technology(key)[source]

Lookup and return a Technology from the technologies of this Device.

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

Remove a child EagleFilePart object.

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

Remove a Connect from the connects of this Device.

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

Remove a Technology from the technologies of this Device.

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

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

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

Set the value of package for this Device. This corresponds to the package attribute of a <device> 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_package(v)[source]

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

Return self if one of the following is true:

  1. package equals v
  2. v is callable and v(self.get_package() 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

Connect

class Swoop.Connect[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • gate
  • pin
  • pad
  • route
clone()[source]

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

Return type:Connect
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_gate()[source]

Find the Gate object refered to by the gate attribute of this object. This is like get_gate(), except it returns the Gate object instead of its name.

Returns:The object
Return type:Gate
find_pad()[source]

Find the Pad object refered to by the pad attribute of this object. This is like get_pad(), except it returns the Pad object instead of its name.

Returns:The object
Return type:Pad
find_pin()[source]

Find the Pin object refered to by the pin attribute of this object. This is like get_pin(), except it returns the Pin object instead of its name.

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

Get all the children of this EagleFilePart.

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

Generate a <connect> element tree for a Connect.

Return type:ElementTree.
get_gate()[source]

Return the value of gate for this Connect. This corresponds to the gate attribute of a <connect> in an Eagle file.

Return type:str
get_pad()[source]

Return the value of pad for this Connect. This corresponds to the pad attribute of a <connect> in an Eagle file.

Return type:str
get_pin()[source]

Return the value of pin for this Connect. This corresponds to the pin attribute of a <connect> in an Eagle file.

Return type:str
get_route()[source]

Return the value of route for this Connect. This corresponds to the route attribute of a <connect> 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_gate(v)[source]

Set the value of gate for this Connect. This corresponds to the gate attribute of a <connect> in an Eagle file.

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

Set the value of pad for this Connect. This corresponds to the pad attribute of a <connect> in an Eagle file.

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

Set the value of pin for this Connect. This corresponds to the pin attribute of a <connect> in an Eagle file.

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

Set the value of route for this Connect. This corresponds to the route attribute of a <connect> in an Eagle file.

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

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

Return self if one of the following is true:

  1. gate equals v
  2. v is callable and v(self.get_gate() 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_pad(v)[source]

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

Return self if one of the following is true:

  1. pad equals v
  2. v is callable and v(self.get_pad() 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_pin(v)[source]

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

Return self if one of the following is true:

  1. pin equals v
  2. v is callable and v(self.get_pin() 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_route(v)[source]

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

Return self if one of the following is true:

  1. route equals v
  2. v is callable and v(self.get_route() 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

Gate

class Swoop.Gate[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • name
  • symbol
  • x
  • y
  • addlevel
  • swaplevel
clone()[source]

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

Return type:Gate
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_symbol()[source]

Find the Symbol object refered to by the symbol attribute of this object. This is like get_symbol(), except it returns the Symbol object instead of its name.

Returns:The object
Return type:Symbol
get_addlevel()[source]

Return the value of addlevel for this Gate. This corresponds to the addlevel attribute of a <gate> in an Eagle file.

Return type:str
get_children()[source]

Get all the children of this EagleFilePart.

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

Generate a <gate> element tree for a Gate.

Return type:ElementTree.
get_name()[source]

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

Return type:str
get_swaplevel()[source]

Return the value of swaplevel for this Gate. This corresponds to the swaplevel attribute of a <gate> in an Eagle file.

Return type:int
get_symbol()[source]

Return the value of symbol for this Gate. This corresponds to the symbol attribute of a <gate> in an Eagle file.

Return type:str
get_x()[source]

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

Return type:float
get_y()[source]

Return the value of y for this Gate. This corresponds to the y attribute of a <gate> 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_addlevel(v)[source]

Set the value of addlevel for this Gate. This corresponds to the addlevel attribute of a <gate> in an Eagle file.

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

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

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

Set the value of swaplevel for this Gate. This corresponds to the swaplevel attribute of a <gate> in an Eagle file.

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

Set the value of symbol for this Gate. This corresponds to the symbol attribute of a <gate> in an Eagle file.

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

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

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

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

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

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

Return self if one of the following is true:

  1. addlevel equals v
  2. v is callable and v(self.get_addlevel() 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_swaplevel(v)[source]

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

Return self if one of the following is true:

  1. swaplevel equals v
  2. v is callable and v(self.get_swaplevel() 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_symbol(v)[source]

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

Return self if one of the following is true:

  1. symbol equals v
  2. v is callable and v(self.get_symbol() 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

Pad

class Swoop.Pad[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • name
  • x
  • y
  • drill
  • diameter
  • shape
  • rot
  • stop
  • thermals
  • first
clone()[source]

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

Return type:Pad
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_diameter()[source]

Return the value of diameter for this Pad. This corresponds to the diameter attribute of a <pad> in an Eagle file.

Return type:float
get_drill()[source]

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

Return type:float
get_et()[source]

Generate a <pad> element tree for a Pad.

Return type:ElementTree.
get_first()[source]

Return the value of first for this Pad. This corresponds to the first attribute of a <pad> in an Eagle file.

Return type:bool
get_name()[source]

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

Return type:str
get_rot()[source]

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

Return type:str
get_shape()[source]

Return the value of shape for this Pad. This corresponds to the shape attribute of a <pad> in an Eagle file.

Return type:str
get_stop()[source]

Return the value of stop for this Pad. This corresponds to the stop attribute of a <pad> in an Eagle file.

Return type:bool
get_thermals()[source]

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

Return type:bool
get_x()[source]

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

Return type:float
get_y()[source]

Return the value of y for this Pad. This corresponds to the y attribute of a <pad> 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_diameter(v)[source]

Set the value of diameter for this Pad. This corresponds to the diameter attribute of a <pad> in an Eagle file.

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

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

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

Set the value of first for this Pad. This corresponds to the first attribute of a <pad> in an Eagle file.

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

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

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

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

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

Set the value of shape for this Pad. This corresponds to the shape attribute of a <pad> in an Eagle file.

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

Set the value of stop for this Pad. This corresponds to the stop attribute of a <pad> in an Eagle file.

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

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

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

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

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

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

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

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

Return self if one of the following is true:

  1. diameter equals v
  2. v is callable and v(self.get_diameter() 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_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_first(v)[source]

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

Return self if one of the following is true:

  1. first equals v
  2. v is callable and v(self.get_first() 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_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_shape(v)[source]

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

Return self if one of the following is true:

  1. shape equals v
  2. v is callable and v(self.get_shape() 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_stop(v)[source]

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

Return self if one of the following is true:

  1. stop equals v
  2. v is callable and v(self.get_stop() 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_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

Smd

class Swoop.Smd[source]

Bases: Swoop.Swoop.EagleFilePart

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

Attributes:

  • name
  • x
  • y
  • dx
  • dy
  • layer
  • roundness
  • rot
  • stop
  • thermals
  • cream
clone()[source]

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

Return type:Smd
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_cream()[source]

Return the value of cream for this Smd. This corresponds to the cream attribute of a <smd> in an Eagle file.

Return type:bool
get_dx()[source]

Return the value of dx for this Smd. This corresponds to the dx attribute of a <smd> in an Eagle file.

Return type:float
get_dy()[source]

Return the value of dy for this Smd. This corresponds to the dy attribute of a <smd> in an Eagle file.

Return type:float
get_et()[source]

Generate a <smd> element tree for a Smd.

Return type:ElementTree.
get_layer()[source]

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

Return type:layer_string
get_name()[source]

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

Return type:str
get_rot()[source]

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

Return type:str
get_roundness()[source]

Return the value of roundness for this Smd. This corresponds to the roundness attribute of a <smd> in an Eagle file.

Return type:int
get_stop()[source]

Return the value of stop for this Smd. This corresponds to the stop attribute of a <smd> in an Eagle file.

Return type:bool
get_thermals()[source]

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

Return type:bool
get_x()[source]

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

Return type:float
get_y()[source]

Return the value of y for this Smd. This corresponds to the y attribute of a <smd> 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_cream(v)[source]

Set the value of cream for this Smd. This corresponds to the cream attribute of a <smd> in an Eagle file.

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

Set the value of dx for this Smd. This corresponds to the dx attribute of a <smd> in an Eagle file.

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

Set the value of dy for this Smd. This corresponds to the dy attribute of a <smd> in an Eagle file.

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

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

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

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

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

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

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

Set the value of roundness for this Smd. This corresponds to the roundness attribute of a <smd> in an Eagle file.

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

Set the value of stop for this Smd. This corresponds to the stop attribute of a <smd> in an Eagle file.

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

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

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

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

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

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

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

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

Return self if one of the following is true:

  1. cream equals v
  2. v is callable and v(self.get_cream() 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_dx(v)[source]

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

Return self if one of the following is true:

  1. dx equals v
  2. v is callable and v(self.get_dx() 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_dy(v)[source]

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

Return self if one of the following is true:

  1. dy equals v
  2. v is callable and v(self.get_dy() 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_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_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_roundness(v)[source]

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

Return self if one of the following is true:

  1. roundness equals v
  2. v is callable and v(self.get_roundness() 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_stop(v)[source]

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

Return self if one of the following is true:

  1. stop equals v
  2. v is callable and v(self.get_stop() 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_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