tendril.boms.electronics module

Electronic Boms Module documentation (boms.electronics)

This module contains various classes for handling structured data present in elctronics BOMs. The module is built for use with gEDA with specific additions and/or constraints to the standard gEDA project structure. Use with other EDA tools should be possible by replacing gedaif with an EDA tool specific package.

Module Summary:

EntityBase() Placeholder class for potentially track-able objects.
EntityElnComp([item]) Object containing a single electronic component.
EntityElnGroup(groupname, contextname) Container for a group of EntityElnComp objects.
import_pcb(cardfolder) Import PCB and return a populated EntityBom

Module Members:

class tendril.boms.electronics.EntityElnComp(item=None)[source]

Bases: tendril.entityhub.entitybase.EntityBase

Object containing a single electronic component.

Accept a gedaif.bomparser.BomLine generated through gnetlist’s bom backend. The attribs file should atleast contain: * device * value * footprint * fillstatus

Parameters:item (gedaif.bomparser.BomLine) – BomLine containing details of component to be created
define(refdes, device, value, footprint='', fillstatus='', schfile=None)[source]

Define the component.

Can be used directly for special cases when there is no tendril.gedaif.bomparser.BomLine to pass to the class __init__ function.

Parameters:
  • refdes – Refdes string.
  • device – Device string.
  • value – Value string.
  • footprint – Footprint string. Optional.
  • fillstatus – Fillstatus string. Optional.
fillstatus

Fillstatus string. When fillstatus is DNP, the component is not included in BOMs irrespective of other configuration states.

ident
device

Component device string.

value

Component value string.

footprint

Component footprint string. MY- at the beginning of the footprint string is stripped away automatically.

class tendril.boms.electronics.EntityElnGroup(groupname, contextname)[source]

Bases: tendril.entityhub.entitybase.EntityGroupBase

Container for a group of EntityElnComp objects.

Variables:groupname – Name of the group
insert(item)[source]

Insert an electronic component into the EntityGroup.

Accept a BomLine and generate an EntityElnComp to represent the component if it’s fillstatus is not DNP. Insert the created EntityElnComp object into the group.

Parameters:item (gedaif.bomparser.BomLine) – BomLine representing the item to insert.
insert_eln_comp(comp)[source]

Insert a manually created component into the EntityGroup.

This should be used for components not originating directly from gEDA’s gnetlist output.

Parameters:comp (EntityElnComp) – Existing component to insert
class tendril.boms.electronics.EntityElnBomConf(projectfolder)[source]

Bases: tendril.gedaif.conffile.ConfigsFile

class tendril.boms.electronics.EntityElnBom(configfile, use_cached=True)[source]

Bases: tendril.entityhub.entitybase.EntityBomBase

validation_errors
pcbname
projfile
projectfolder
motifs
create_groups()[source]
find_group(groupname)[source]

:rtype : EntityElnGroup

find_tgroup(item)[source]

:rtype : EntityElnGroup

_add_item(item)[source]
populate_bom(use_cached=True)[source]
get_motif_by_refdes(refdes)[source]
configured_for
configure_motifs(configname)[source]
create_output_bom(configname, groupname=None)[source]
get_group_boms(configname)[source]
indicative_cost_hierarchical_breakup(configname)[source]
tendril.boms.electronics.import_pcb(cardfolder)[source]

Import PCB and return a populated EntityBom

Accept cardfolder as an argument and return a populated EntityBOM. The cardfolder should be the path to a PCB folder, containing the file structure described in somewhere.

See also

  • gedaif.projfile.GedaProjectFile
  • gEDA Project Folder Structure
Parameters:cardfolder (str) – PCB folder (containing schematic, pcb, gerber)
Returns:Populated EntityBom
Return type:EntityBom
Example:
>>> import tendril.boms.electronics
>>> bom = tendril.boms.electronics.import_pcb('path/to/cardfolder')