Running KiCost in BOM dialog window!? Persistanten configuraion?

Hello

After consulting the forums here + finding this post on stack overflow which discussed the error I was getting:

I was able to get Kicost running form withing the BOM dialog window:
billede

The command, for your mark/copy/past pleassure:
python -E /usr/bin/kicost --overwrite -i ‘%I’ -o ‘%O.xlsx’

From the python man page regarding the -E option:
" -E Ignore environment variables like PYTHONPATH and PYTHONHOME that
modify the behavior of the interpreter."

Does someone know why this works and whether this can be a lasting solution? I am running arch linux and have KiCost installed via its aur package.

Secondly, I wanted to inquire if someone knows how to keep the BOM dialog window persistent? Currently, it seems necessary to copy/paste the command line into the BOM dialog after a restart of Kicad. Not only am I driven by utter laziness, this is one of the few flow breakers that put me on a tangent making me forget what I was trying to do (Simple mind and so forth).

Wanted to mention: KiCost is awesome and I find the manf and manf# keywords especially elegant.

Thank you for your time.

@JonnyDumb, try to use python3 instead python to call KiCost. The last published version is not yet compatible with Python 2.
You should be able also to call using only kicost -i '%I'.

To “keep the command line” you have to “add plugin” and create this profile of KiCost.

1 Like

Spot on! This works without the ‘-E’ option.

I tried

kicost -i “%I” --overwrite

and it worked. Thank you for pointing this out again!

Finally, I tried again to add some plugins, including KiCost and the configuration was persistent (tried to restart KiCad and reboot the computer).

Thank you very much @hildogjr, I must have confused myself by overlooking stuff :sweat_smile:

No problem, the goal of the forum is this kind of help.
KiCost is freeze now due the scrape / API key issues, I hope you can use it fine.

Admittedly, KiCost does not work for me right now, but I did not look into those issues and thought I should creaete a new thread with an appropriate title?
I do see scraper errors like this:

Received 403, scraper possibly detected: Starting new session for https://www.digikey.com

Kicost exist with:
Traceback (most recent call last):
File “/usr/bin/kicost”, line 11, in
load_entry_point(‘kicost==0.1.47’, ‘console_scripts’, ‘kicost’)()
File “/usr/lib/python3.7/site-packages/kicost/main.py”, line 289, in main
local_currency=args.currency)
File “/usr/lib/python3.7/site-packages/kicost/kicost.py”, line 329, in kicost
res_dist = res_proc.get()
File “/usr/lib/python3.7/multiprocessing/pool.py”, line 657, in get
raise self._value
File “/usr/lib/python3.7/multiprocessing/pool.py”, line 121, in worker
result = (True, func(*args, **kwds))
File “/usr/lib/python3.7/site-packages/kicost/kicost.py”, line 314, in mt_scrape_part
retval.append(inst.scrape_part(i, parts[i]))
File “/usr/lib/python3.7/site-packages/kicost/distributors/distributor.py”, line 128, in scrape_part
html_tree, url = self.get_part_html_tree(part)
File “/usr/lib/python3.7/site-packages/kicost/distributors/distributor.py”, line 166, in get_part_html_tree
return self.dist_get_part_html_tree(part.fields[key], extra_search_terms)
File “/usr/lib/python3.7/site-packages/kicost/distributors/mouser/mouser.py”, line 299, in dist_get_part_html_tree
match = difflib.get_close_matches(pn, part_numbers, 1, 0.0)[0]
IndexError: list index out of range

I use the Arch User Repository (AUR) package. This is very convenient, but may not be the preferred method (which seems to be using pip?).

Would you be able to point me in the right direction to read up on the issue?

Also, thanks for the GUI!

We didn’t update the scrape modules and start to use Octopart API. Despite the speed, some user proclaim because of the Octopart register necessity and because Octopart doesn’t not give free keys anymore.
Please, check the discussion at

Thank you! will monitor the discussion and compare with the issue I am seeing.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.