BOM from Eschema


#1

I cannot find my post on BOM scripts.
By monkeying around, I found the solution. The BOM creates an xsl file. From MSFT I read that the " in Excel, view data" is an option to read out BOM contents from the alphabet soup. & I got a very nicely formatted BOM.
love it. thnx much


#2

This FAQ article might interest you: How to create a bill of materials (BOM)?


#3

oh well, I spent several hrs trying to get BOM without success. Although the one by KiCost appears most suitable for us. Data read from Excel from .xml is virtually useless.
But I just could not succeed in running the Python scripts after down loading WPython64 & KiCost. I modified fields in all parts to “manf#”…a lot of time spent doing that…
The Youtube video is very enticing but there must be some other format/syntax of entering the commands in W10 command line. Only if you run a script from inside KiCAD BOM consol do you get an .xml. The video shows it is generated without any?
Any help will be highly appreciated.


#4

Did you even read my article? In it i show how you get a html file as output. (But if you look closely at the screenshot where i select the plugin you will notice that some of the scripts mention the output format csv.)

More details:
The xml file is what is used by bom plugins to generate the output format you desire. (See it as an intermediate file. Not something intended for the eyes of the end-user.) This xml file is then parsed by some script (python, node js, …) and converted into the desired output format. There are many scripts shipped with kicad already but there are also 3rd party plugins and even external tools.


#5

Thanks for the prompt reply. Not only did I read your earlier reply, I tried to follow including trying out others you suggested. Honest assessment of this will be that I could not follow thru or my w10 laptop does not respond to plugins the way developer expected. I did get xml formatted output but Excel did not produce useful data. I watched KiCost video- and liked what he did but I failed to run Python script!
I will keep trying.
Then post happy results.
Robin


Interactive Html Bom Plugin for KiCad 5.0
#6

I don’t think you’ve posted in this thread, maybe misplaced reply? It’s kind of out of context.


#7

@Robin, KiCost is an other KiCad plugin focus on BOM cost (https://github.com/xesscorp/KiCost/).
Here, iBOM is focus in PCB assembly (https://github.com/openscopeproject/InteractiveHtmlBom/).
You misplaced the thread.


#8

Yes was misplaced. Moved to correct thread.


#9

Well what exactly did you try? What did behave differently to what is expected? Was there any error output in the BOM dialog?

as mentioned above the xml file itself is not what you should load into excel! (Just to be sure that we talk about the same thing here an explanation of what an xml file is: https://www.w3schools.com/xml/xml_whatis.asp)


#10

@Robin_Gangopadhya, specify your error.
Did you install using pip? Did you install in Python2 or Python3? (KiCost is just running now in python3).
KiCost read the XML file to generate the XLSX file.


#11

Sorry: I was not pursuing the BOM issues for all these days…did not see you suggestions/questions.
Just now tried to find python3…came out as 3.7.3 or some such. Installed but could not run. I mean I double clicked the .exe file. Cannot tell if Py was installed or not.
I see a folder full of KiCost files …
Then I tried to “install” KiCost thru pypi- again . All I get is an icon that comes up as “copy to clipboard”.
then what?
I think I have to watch the Python programing video again.
I am thinking too much in terms of Windows program installation…


#12

So, are you using Windows? How did you try to install KiCost?

Try this command:

python3 -m pip install kicost

This will force pip to be executed through Python3 (at least on Linux).


#13

Excuse me for coming in & going out of this effort in getting a BOM from xml file in KiCAD. I find kicost to be so elegeant…but all efforts so far have not worked for me.
Today, I downloaded python 3.7.3
“installed” by dbl clicking the .exe file
Upon finish, it asked me if the path should be put in the ENV
I said yes.
Then on to Kicost.
I got to windows command screen thru “cmd”
there I copy paste
python3 -m pip install kicost
nothing happens.
Should I type it in instead of copy-paste ?


#14

As a matter of fact, WHAT do you download for kicost?
It is a circular set of links I click on.
Yet, I do see a download with extension ------non-any.whl in my computer.

Then what do you do?
“Install” this program/script by this command in windows command screen?
python3 -m pip install kicost
?
thnx for any help.
robin


#15

Hey y’all
I thought of giving you real feedback about the kicost thing that people seem to have problems…
So here is the how I got it from horse’s mouth

  • install python 3.7.3
  • download kicost
  • sign up with Octopart. Get an apiKey from them
  • Octpopart needs time to review your account & approve the key
  • the download visual studio fee version.
    Open kicost.py
    Enter your apiKey code in line 220
  • make sure it is entered correctly in single quotes without disturbing anything else.
  • save the updated kicost.py

in DOS command line I type using my xml file name
C:\Users\Robin\Documents>kicost -i single_pfc10vref.xml

I will update this info tomorrow when I get my key accepted.
fyi


#16

I am a LInux user. But I think when you install Python3 at Windows it is called just by python. So, the two followed commands should work:

python -m pip install kicost
pip install kicost

If something goes wrong when you start KiCost, you can replace the installation folder by this most recent version https://github.com/xesscorp/KiCost/tree/octopart.

In some days we intent release a version with new fix https://github.com/xesscorp/KiCost but so far, we are without developers to help fix the last bugs.


#17

Hildogjr
Thanks a lot for keeping an eye on this issue.
Octopart seems to be built in the .py file.
I dare not yet remove it.
But I will.
Octopart folks are asking “how many times do we plan to visit their website”…a question no one would knany for sure…
Por favor.
So if they are not going to approve the account, we will have to find a general approach to using kicost which does not depend upon such shenanigans.
Will let you know.
r


#18

@Robin_Gangopadhya
Next version of KiCost add support to PartInfo - KiSpace API that in some point will make KiCost be able also to automatic select resistors and capacitors without provide the part number.
It will be also able to support additional APIs for each distributors web site.

For now KiCost team are composed just by one person + the author and we need people to provide fix and report issues. Mainly the related with the GUI and Windows behavior.


#19

Hello Hildogjr:
Thanks for the update.
I was looking into the .py file, it is full of octopart imports.
And Octopart is not something you want to embed such an important application.
Another thing is that the app assumes a certain set of entries-- in order-- in the “properties” fields of parts in KiCAD.
Could you post what this order is and if they are case dependent?
I have full Python support here so may be we can build kicost to be more general and useful with simple command in DOS CMD screen.
I wish you luck with some expert developers contributing to make kicost very effective and useful.
-robin


#20

KiCost start as terminal command only, this page have all supported commands

Check this old video


about the use.

Basically, all field names listed at the documentation are alias for the “manufacture part number”. For example, I frequently use “p#” fields in my schematic and “digikey#” / “mouser#” when I want specify part found just in this two distributors. So I call KiCost as:

kicost --include digikey mouser -i MY_BOM.xml

--include argument is optional to just output the specified distributors. The GUI was a invention mine to made KiCost easy to use from person to habituated with terminal.