Latest version of KiCost: Faster! Custom Pricing!

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
2 Likes

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.

@devbisme
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”.

1 Like

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.
2 Likes

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.
3 Likes

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

1 Like

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\kicost_gui.py”, 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\kicost-script.py”, line 11, in
load_entry_point(‘kicost==0.1.43’, ‘console_scripts’, ‘kicost’)()
File “D:\Anaconda3\lib\site-packages\pkg_resources_init_.py”, line 572, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “D:\Anaconda3\lib\site-packages\pkg_resources_init_.py”, line 2755, in load_entry_point
return ep.load()
File “D:\Anaconda3\lib\site-packages\pkg_resources_init_.py”, line 2408, in load
return self.resolve()
File “D:\Anaconda3\lib\site-packages\pkg_resources_init_.py”, 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\kicost_main_.py”, line 37, in
from .kicost_gui import * # User guide.
File “D:\Anaconda3\lib\site-packages\kicost-0.1.43-py3.6.egg\kicost\kicost_gui.py”, line 33, in
raise ImportError(‘wxPython package not recognised.’)
ImportError: wxPython package not recognised.

Martin

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

To fix, please, replace the __main__.py file by this one https://github.com/hildogjr/KiCost/blob/master/kicost/main.py

You can install also using
pip install git+https://github.com/xesscorp/KiCost.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?

Yes, @devbisme fixed Mouse. But appear that Mouser are blocking multiple consecutive access. Try to use the --throttling_delay to give some time between two Mouser access.

1 Like

KiCost 0.1.44 released.
Some changes did: https://github.com/xesscorp/KiCost/blob/master/HISTORY.rst

1 Like

News:
Thanks to GitHub user Max Maisel that help implementing the class on KiCost distributors, we are now releasing version 0.1.45 on PyPI.
We still working on improvements, minor issues and GUI, even some warning on Python 2.7. But I chose to release because this all issues related with not scrape results.
Please, gives us feed back and (code) contributions.

2 posts were split to a new topic: KiCost thread ‘derailment’