Files
-
PCB / ACC / CIAA_ACC / BANK_0.sch
-
PCB / ACC / CIAA_ACC / BANK_112.sch
-
PCB / ACC / CIAA_ACC / BANK_500.sch
-
PCB / ACC / CIAA_ACC / BANK_501.sch
-
PCB / ACC / CIAA_ACC / BANK_502.sch
-
PCB / ACC / CIAA_ACC / BANKS_HP.sch
-
PCB / ACC / CIAA_ACC / BANKS_HR.sch
-
PCB / ACC / CIAA_ACC / ciaa_acc.kicad_pcb
-
PCB / ACC / CIAA_ACC / ciaa_acc.sch
-
PCB / ACC / CIAA_ACC / Digital_IO.sch
-
PCB / ACC / CIAA_ACC / Expansion.sch
-
PCB / ACC / CIAA_ACC / FMC-Power.sch
-
PCB / ACC / CIAA_ACC / FPGA-Power.sch
-
PCB / ACC / CIAA_ACC / OneBank.sch
-
PCB / ACC / CIAA_ACC / PMIC.sch
-
PCB / ACC / CIAA_ACC / Principal.sch
-
PCB / ACC / CIAA_ACC / RTC-HDMI.sch
-
PCB / EDU-FSL / EDU_CIAA_K60 / cpu.sch
-
PCB / EDU-FSL / EDU_CIAA_K60 / EDU_CIAA_K60.kicad_pcb
-
PCB / EDU-FSL / EDU_CIAA_K60 / EDU_CIAA_K60.sch
-
PCB / EDU-FSL / EDU_CIAA_K60 / fuente.sch
-
PCB / EDU-FSL / EDU_CIAA_K60 / gpio.sch
-
PCB / EDU-FSL / EDU_CIAA_K60 / JTAG.sch
-
PCB / EDU-FSL / EDU_CIAA_K60 / on_board_io.sch
-
PCB / EDU-FSL / EDU_CIAA_K60 / rsS485.sch
-
PCB / EDU-FSL / EDU_CIAA_K60 / usb_otg.sch
-
PCB / EDU-INTEL / cpu.sch
-
PCB / EDU-INTEL / edk.kicad_pcb
-
PCB / EDU-INTEL / edk.sch
-
PCB / EDU-INTEL / power.sch
-
PCB / EDU-INTEL / sd_card.sch
-
PCB / EDU-INTEL / usb.sch
-
PCB / EDU-NXP / cpu.sch
-
PCB / EDU-NXP / edu-ciaa-nxp.kicad_pcb
-
PCB / EDU-NXP / edu-ciaa-nxp.sch
-
PCB / EDU-NXP / fuente.sch
-
PCB / EDU-NXP / gpio.sch
-
PCB / EDU-NXP / ON_BOARD_IO.sch
-
PCB / EDU-NXP / rsS485_can.sch
-
PCB / EDU-NXP / usb.sch
-
PCB / EDU-XILINX / ProyectoKicad / Bank14.sch
-
PCB / EDU-XILINX / ProyectoKicad / Bank15.sch
-
PCB / EDU-XILINX / ProyectoKicad / Bank35.sch
-
PCB / EDU-XILINX / ProyectoKicad / EduCiaaX.sch
-
PCB / EDU-XILINX / ProyectoKicad / FPGAConfig.sch
-
PCB / EDU-XILINX / ProyectoKicad / FPGAPower.sch
-
PCB / EDU-XILINX / ProyectoKicad / Power.sch
-
PCB / EDU-XILINX / ProyectoKicad / Usb.sch
-
PCB / FSL-MINI / CIAA_FSL_MINI.kicad_pcb
-
PCB / FSL-MINI / CIAA_FSL_MINI.sch
-
PCB / FSL-MINI / cpu.sch
-
PCB / FSL-MINI / ethernet.sch
-
PCB / FSL-MINI / fuente.sch
-
PCB / FSL-MINI / IO.sch
-
PCB / FSL-MINI / memories.sch
-
PCB / FSL-MINI / usb_otg.sch
-
PCB / FSL / CIAA_K60 / analog.sch
-
PCB / FSL / CIAA_K60 / analog_out.sch
-
PCB / FSL / CIAA_K60 / CIAA_K60.kicad_pcb
-
PCB / FSL / CIAA_K60 / CIAA_K60.sch
-
PCB / FSL / CIAA_K60 / cpu.sch
-
PCB / FSL / CIAA_K60 / din.sch
-
PCB / FSL / CIAA_K60 / dout.sch
-
PCB / FSL / CIAA_K60 / ethernet.sch
-
PCB / FSL / CIAA_K60 / fuente.sch
-
PCB / FSL / CIAA_K60 / gpio.sch
-
PCB / FSL / CIAA_K60 / JTAG.sch
-
PCB / FSL / CIAA_K60 / memories.sch
-
PCB / FSL / CIAA_K60 / rsS485_rs232_can.sch
-
PCB / FSL / CIAA_K60 / usb_otg.sch
-
PCB / NXP / .kicad_pcb.kicad_pcb
-
PCB / NXP / analog.sch
-
PCB / NXP / analog_out.sch
-
PCB / NXP / ciaa-nxp.kicad_pcb
-
PCB / NXP / ciaa-nxp.sch
-
PCB / NXP / cpu.sch
-
PCB / NXP / din.sch
-
PCB / NXP / dout.sch
-
PCB / NXP / ethernet.sch
-
PCB / NXP / fuente.sch
-
PCB / NXP / gpio.sch
-
PCB / NXP / mem.sch
-
PCB / NXP / rsS485_rs232_can.sch
-
PCB / NXP / usb_otg.sch
-
PCB / PIC / analog.sch
-
PCB / PIC / analog_out.sch
-
PCB / PIC / ciaa-pic.kicad_pcb
-
PCB / PIC / ciaa-pic.sch
-
PCB / PIC / cpu.sch
-
PCB / PIC / din.sch
-
PCB / PIC / dout.sch
-
PCB / PIC / ethernet.sch
-
PCB / PIC / fuente.sch
-
PCB / PIC / gpio.sch
-
PCB / PIC / JTAG.sch
-
PCB / PIC / mem.sch
-
PCB / PIC / rsS485_rs232_can.sch
-
PCB / PIC / usb_otg.sch
-
PCB / pico / cpu.sch
-
PCB / pico / debugger.sch
-
PCB / pico / picociaa.kicad_pcb
-
PCB / pico / picociaa.sch
-
PCB / RX / hw / .kicad_pcb.kicad_pcb
-
PCB / RX / hw / analog.sch
-
PCB / RX / hw / analog_out.sch
-
PCB / RX / hw / ciaa-rx.kicad_pcb
-
PCB / RX / hw / ciaa-rx.sch
-
PCB / RX / hw / cpu.sch
-
PCB / RX / hw / din.sch
-
PCB / RX / hw / dout.sch
-
PCB / RX / hw / ethernet.sch
-
PCB / RX / hw / fuente.sch
-
PCB / RX / hw / gpio.sch
-
PCB / RX / hw / mem.sch
-
PCB / RX / hw / rsS485_rs232_can.sch
-
PCB / RX / hw / usb_otg.sch
-
PCB / Safety / BUS_ISA.sch
-
PCB / Safety / CAN.sch
-
PCB / Safety / CIAA_Safety_VTI_1.0.kicad_pcb
-
PCB / Safety / CIAA_Safety_VTI_1.0.sch
-
PCB / Safety / CPU.sch
-
PCB / Safety / ETHERNET.sch
-
PCB / Safety / MEM_FLASH_SPI.sch
-
PCB / Safety / RM48L952.sch
-
PCB / Safety / USB HOST - MEM SD.sch
-
PCB / Safety / USB OTG.sch
-
PCB / Safety / USB.sch
-
PCB / Z3R0 / ciaa-z3r0.kicad_pcb
-
PCB / Z3R0 / ciaa-z3r0.sch
Last update 5 years 8 months
by
Noelia Scotti
FilesPCBEDU-INTELbom_scripts | |
---|---|
.. | |
bom2csv.xsl | |
bom_csv_grouped_by_value.py | |
bom_cvs.xsl | |
kicad_netlist_reader.py | |
kicad_netlist_reader.pyc | |
python readme.txt |
bom_csv_grouped_by_value.py# # Example python script to generate a BOM from a KiCad generic netlist # # Example: Sorted and Grouped CSV BOM # from __future__ import print_function # Import the KiCad python helper module and the csv formatter import kicad_netlist_reader import csv import sys if len(sys.argv) != 3: print("Usage ", __file__, "<generic_netlist.xml> <output.csv>", file=sys.stderr) sys.exit(1) # Generate an instance of a generic netlist, and load the netlist tree from # the command line option. If the file doesn't exist, execution will stop net = kicad_netlist_reader.netlist(sys.argv[1]) # Open a file to write to, if the file cannot be opened output to stdout # instead try: f = open(sys.argv[2], 'w') except IOError: e = "Can't open output file for writing: " + sys.argv[2] print( __file__, ":", e, sys.stderr ) f = sys.stdout # subset the components to those wanted in the BOM, controlled # by <configure> block in kicad_netlist_reader.py components = net.getInterestingComponents() compfields = net.gatherComponentFieldUnion(components) partfields = net.gatherLibPartFieldUnion() # remove Reference, Value, Datasheet, and Footprint, they will come from 'columns' below partfields -= set( ['Reference', 'Value', 'Datasheet', 'Footprint'] ) columnset = compfields | partfields # union # prepend an initial 'hard coded' list and put the enchillada into list 'columns' columns = ['Item', 'Qty', 'Reference(s)', 'Value', 'LibPart', 'Footprint', 'Datasheet'] + sorted(list(columnset)) # Create a new csv writer object to use as the output formatter out = csv.writer( f, lineterminator='\n', delimiter=',', quotechar='\"', quoting=csv.QUOTE_MINIMAL ) # override csv.writer's writerow() to support utf8 encoding: def writerow( acsvwriter, columns ): utf8row = [] for col in columns: utf8row.append( str(col).encode('utf8') ) acsvwriter.writerow( utf8row ) # Output a set of rows as a header providing general information writerow( out, ['Source:', net.getSource()] ) writerow( out, ['Date:', net.getDate()] ) writerow( out, ['Tool:', net.getTool()] ) writerow( out, ['Component Count:', len(components)] ) writerow( out, [] ) writerow( out, ['Individual Components:'] ) writerow( out, [] ) # blank line writerow( out, columns ) # Output all the interesting components individually first: row = [] for c in components: del row[:] row.append('') # item is blank in individual table row.append('') # Qty is always 1, why print it row.append( c.getRef() ) # Reference row.append( c.getValue() ) # Value row.append( c.getLibName() + ":" + c.getPartName() ) # LibPart #row.append( c.getDescription() ) row.append( c.getFootprint() ) row.append( c.getDatasheet() ) # from column 7 upwards, use the fieldnames to grab the data for field in columns[7:]: row.append( c.getField( field ) ); writerow( out, row ) writerow( out, [] ) # blank line writerow( out, [] ) # blank line writerow( out, [] ) # blank line writerow( out, ['Collated Components:'] ) writerow( out, [] ) # blank line writerow( out, columns ) # reuse same columns # Get all of the components in groups of matching parts + values # (see kicad_netlist_reader.py) grouped = net.groupComponents(components) # Output component information organized by group, aka as collated: item = 0 for group in grouped: del row[:] refs = "" # Add the reference of every component in the group and keep a reference # to the component so that the other data can be filled in once per group for component in group: if len(refs) > 0: refs += ", " refs += component.getRef() c = component # Fill in the component groups common data # columns = ['Item', 'Qty', 'Reference(s)', 'Value', 'LibPart', 'Footprint', 'Datasheet'] + sorted(list(columnset)) item += 1 row.append( item ) row.append( len(group) ) row.append( refs ); row.append( c.getValue() ) row.append( c.getLibName() + ":" + c.getPartName() ) row.append( net.getGroupFootprint(group) ) row.append( net.getGroupDatasheet(group) ) # from column 7 upwards, use the fieldnames to grab the data for field in columns[7:]: row.append( net.getGroupField(group, field) ); writerow( out, row ) f.close()