Export layer stack in easy format

I want to export the layer stack for further processing. The only option I see is “Export to Clipboard” button, which gives me e.g.:

layer "F.Silkscreen" type "Top Silk Screen" Color "Not specified" Material "Not specified"
layer "F.Paste" type "Top Solder Paste"
layer "F.Mask" type "Top Solder Mask" Color "Not specified" Thickness 0.01 mm Material "Not specified" EpsilonR 3.3 LossTg 0
layer "F.Cu" type "copper" Thickness 0.035 mm
layer "Dielectric 1" type "core"
  sublayer "1/3" Color "Not specified" Thickness 1.51 mm Material "FR4" EpsilonR 4.5 LossTg 0.02
  sublayer "2/3" Thickness 0 mm Material "Not specified" EpsilonR 1 LossTg 0
  sublayer "3/3" Thickness 0 mm Material "Not specified" EpsilonR 1 LossTg 0
layer "B.Cu" type "copper" Thickness 0.035 mm
layer "B.Mask" type "Bottom Solder Mask" Color "Not specified" Thickness 0.01 mm Material "Not specified" EpsilonR 3.3 LossTg 0
layer "B.Paste" type "Bottom Solder Paste"
layer "B.Silkscreen" type "Bottom Silk Screen" Color "Not specified" Material "Not specified"
Finish "None"

I want to create a simple CSV table with the layer stack, but going from this format into a table is cumbersome. The table I want to create is basically the same that is shown in the layer stack window:

Is there a script or something that does this? Is it possible to get this information in a more computer-friendly format like json or yaml? Or how would I get it from Python? Is the pcbnew package able to do this?

The info in the Panel is available in the kicad_pcb file. You should know enough by now to open it in a Text-Editor and see the info.

I wrote several Python codes (and App’s to show it and have posted some codes (if you care to search for them). Screenshot below shows example…

ADDED: And, there’s the ‘Export to Clipboard’ button in the Stackup panel…

ADDED: It occurred to me that perhaps you can simply Export to Clipboard, then Paste it into Spreadsheet (such as Libre’s Calc.

If you specify a Delimeter as " (see screenshot below) then the data will be columnized and useful.

2 Likes