Latest version of KiCost: Faster! Custom Pricing!


@devbisme that sounds like the problem but it doesnt seem to behave still :confused:
tried: “kicost -i Aeronav_R.xml --overwrite --variant lala” which would still include my U22 component which has the kicost:variant field


Send me the XML file that you are using. What is the variant assigned to U22? Is U22 included or excluded from the spreadsheet generated when you used --variant lala?


Sending it over PR, Variant is BAT_BACKUP and its always included.


Try renaming the field variant. The kicost:variant field isn’t working like I expected.


using variant instead of kicost:variant did the trick :slight_smile:
thanks for your help :slight_smile: gonna save me a lot of manual labor :slight_smile:


That post was a mistake from posting in the middle of the night, withdrawn now. The best decoupling at UHF and above is from the smaller packages and 1nF or less, with direct device lead and plane connections


The kicost:variant fields now work.

KiCost will now omit any part with a variant if the --variant option is not used, so you don’t have to use the --variant lala nonsense anymore.

The new KiCost 0.1.36 is up on PyPi so you can install it with:

pip install -U kicost


did a little testing with a field for DNP, my conclusion was
Fieldname – Fieldvalue
dnp – 1 //didnt get excluded
kicost:dnp – 1 //didnt get excluded
dnp – True //got excluded
kicost:dnp – True //didnt get excluded

if I understood it correctly all of the above should work for excluding parts


I failed to apply the fix that handles “kicost:variant” to the “kicost:dnp” field. So only “dnp” fields are handled correctly by KiCost 0.1.36. Or you can install from the Github repo to get the corrected program.


You can send me your XML file. The test case “dnp – 1” should have excluded the part. At least it did for my testing.


Hey Dave
could it be possible to make an option for “inverted variant”?
the usecase would practically be to have some parts always show up unless a specific variant is called.
for example I have a design with some optional input protection, when not needed I need to add some other parts in order to bypass it.
Currently I do like so.
all parts for input protection has a variant called INPUT_PROTECTION
all the bypass parts have a variant called NO_INPUT_PROTECTION
what I would suggest would be an option to add a “!” in front of the variant name to not add it when the variant is called.
like so:
input protection part: variant -> INPUT_PROTECTION
bypass parts: variant -> !NO_INPUT_PROTECTION


It’s something I can look at. Please enter it as an issue on the KiCost Github page.

It looks like we’re heading toward some type of Boolean expression involving the variant, e.g. “use this part if it’s in variant A but not in variants B or C”.


Maybe use ~ in the beginning of the variant name (KiCad use this to NOT the signal labels).


KiCost updated (v0.1.42) adding the functionalities:

  1. Multiple BOM file to generate a single spreadsheet (useful in the case of a project with multiple boards or for control of the importation taxes);
  2. Read CSV BOM (may be a hand-made). Allow to use older projects (or others EDA) and to add tools and other parts that is not components to the spreadsheet.


It’s some issue related with the Office suite, I think. Usually happens with LibreOffice Calc, but not with MSO and Google.


Guys, new KiCost version (v0.1.43) available. The main new features:

  1. Merge more than one BOM to create a single spreadsheet;
  • Read CSV files hand made or other EDA software (tested Proteus and Eagle) to you reuse older designs;
  • Rewritten the Altium XML read module;
  • Graphical interface (in beta), to call just type kicost without parameters;
  • --no_scrape parameter (could be used to create a spreadsheet without distributors informations). Equivalent to --exclude "all";
  • Added --throttling_delay option to add delay between accesses to distributor websites. Useful when they start to block multiple access;
  • Solved distributors issues and improvements. Reorganized files and functions to better contribution and maintenance.


You know you’re doing a good job if there is less and less questions & problems :wink:


Downloaded Anaconda3, with pytthon 3.6.
Installed kicost with easy install.

I get the attached error message when i try to open my .xml BOM from kicad with kicost.exe.
Does anyone have a working .xml file I can try?

(base) C:\Users\m_mau\OneDrive\My Documents\Skole\Hibu\Gruppe 13\PCB\Strømregulator\Shunt TAE MR\ACS770_200A>kicost -i ACS770_200A.xml
Traceback (most recent call last):
File “D:\Anaconda3\lib\site-packages\kicost-0.1.43-py3.6.egg\kicost\”, line 31, in
import wx # wxWidgets for Python.
ModuleNotFoundError: No module named ‘wx’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\Anaconda3\Scripts\”, line 11, in
load_entry_point(‘kicost==0.1.43’, ‘console_scripts’, ‘kicost’)()
File “D:\Anaconda3\lib\site-packages\”, line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “D:\Anaconda3\lib\site-packages\”, line 2755, in load_entry_point
return ep.load()
File “D:\Anaconda3\lib\site-packages\”, line 2408, in load
return self.resolve()
File “D:\Anaconda3\lib\site-packages\”, line 2414, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “D:\Anaconda3\lib\site-packages\kicost-0.1.43-py3.6.egg\”, line 37, in
from .kicost_gui import * # User guide.
File “D:\Anaconda3\lib\site-packages\kicost-0.1.43-py3.6.egg\kicost\”, line 33, in
raise ImportError(‘wxPython package not recognised.’)
ImportError: wxPython package not recognised.



Error founded. Could you create a ISSUE on GitHUB, just to track the modifications?

To fix, please, replace the file by this one

You can install also using
pip install git+
instead of
pip install kicost
and get the last code version with this correction.

Thanks by the report.


Hi @hildogjr

I just gave the “git” version a spin, Mouser still doesnt seem to show up.
wasnt that fixed some time ago?