Kicost not finding components; still working in September 2018?


#1

Trying to use kicost on both win10 and ubuntu18.04, I get an .xlsx with 0 available parts in most fields and the following command line output:

No currency/country configuration for rs.
No currency/country configuration for tme.
No currency/country configuration for farnell.
No currency/country configuration for newark.
Part [‘U1’, ‘U2’] not found at rs.
Part [‘U1’, ‘U2’] not found at newark.
Part [‘U1’, ‘U2’] not found at farnell.
Part [‘U1’, ‘U2’] not found at digikey.
Part [‘U9’] not found at mouser.

I am using the “manf#” field in all components and the manf# values are all verified and working in human searches of various sites.

I am following the instructions in the kicost docs with:
$ kicost -i schematic.xml

I have tried setting throttling delay as suggested.

Are there additional steps I need to go through to get the scraping to work?

Working from Ireland on ubuntu 18.04 and windows 10 using .xmls generated from KiCAD 5.0


#2

I don’t use KiCost regularly, but I remember seeing a new version notification on the forums here. See this thread:

One of the problems inherent with programs like this is the constant chase to stay up to date as vendors change their APIs and/or web page formats. KiCost is now using the OctoPart API. This means only one API that KiCost has to keep up to date with, and offloads the vendor specific changes to OctoPart’s team. :wink:


#3

@kickofighto, as @SembazuruCDE said, we are using Octopart API now. But the code is not officially released (missing update the documentation).
In the new features we have GUI, a 100x faster response, currency conversion, …
Make a manual update downloading on https://github.com/xesscorp/KiCost/tree/octopart or run

sudo -H pip3 install -U git+https://github.com/xesscorp/KiCost.git@octopart
% To install to all users.

#4

Just marking @devbisme to acknowledgment that all scrape stopped.


#5

Hi @hildogjr I’m using KiCost too and I did your instructions above and it sill says ‘Parts not found at digikey’ or any other vendor.

I run ubuntu 18.04 , KiCAD 5.


#6

@BarakG, could you write the command used to install?
Are you using Pytho2 or 3?
What is the answer to kicost --version?


#7

I did
sudo -H pip install -U git+https://github.com/xesscorp/KiCost.git@octopart

my python version
Python 2.7.15rc1

and KiCost version
KiCost 0.1.47


#8

Could you install on python3? Or pass me the XML file?
May be a issue related with python version.


#9

I will check for python 3.
about my XML - https://pastebin.com/c4ZmsaA4

Thank you very much @hildogjr


#10

It was fine on Ubuntu 16.04 Python3.
Could you rise a issue reporting this Python2 problem at https://github.com/xesscorp/KiCost? (and reinstall on Python3?)

sudo apt install python3-pip
sudo -H pip install -U git+https://github.com/xesscorp/KiCost.git@octopart

#11

@hildogjr I have been upgraded my python to python 3.6.6 and still the same problem.
I did sudo apt install python3-pip and sudo apt-get install python3 also I did this alias alias python=python3 to make sure that python3 is executed.


#12

Please run kicost -wi demo.xml --debug 8
The fist line will return something like

Started KiCost v.0.1.47 on Linux-4.4.0-135-generic-x86_64-with-Ubuntu-16.04-xenial(64bit) Python 3.5.2

#13

It seems like it runs python 2.7
Started KiCost v.0.1.47 on Linux-4.15.0-34-generic-x86_64-with-Ubuntu-18.04-bionic(64bit) Python 2.7.15


#14

Yes, this first line was created exactly to this debug.

Try some pip uninstall kicost before pip3 install kicost.


#15

It works. Thank you very much!


#16

When I run this currency conversion works but can’t find demo.xml. Where does it/should it live?

~$ kicost -wi demo.xml --debug 8
Started KiCost v.0.1.47 on Linux-4.15.0-34-generic-x86_64-with-Ubuntu-18.04-bionic(64bit) Python 3.6.6
Exchange rate: 1 EUR = 1.16 USD

Getting from XML ‘demo.xml’ KiCad BoM…

Traceback (most recent call last):
File “/home/ash/.local/bin/kicost”, line 11, in
sys.exit(main())
File “/home/ash/.local/lib/python3.6/site-packages/kicost/main.py”, line 289, in main
local_currency=args.currency)
File “/home/ash/.local/lib/python3.6/site-packages/kicost/kicost.py”, line 125, in kicost
p, info = eda_tool_module.get_part_groups(in_file[i_prj], ignore_fields, variant[i_prj])
File “/home/ash/.local/lib/python3.6/site-packages/kicost/eda_tools/kicad/kicad.py”, line 96, in get_part_groups
file_h = open(in_file)
FileNotFoundError: [Errno 2] No such file or directory: ‘demo.xml’

edit: never mind I see what’s going on here; I assumed demo.xml was bundled with kicost.


#17

This demo.xml was a file of @BarakG.
KiCost have a folder full of examples in %PYTHON_PLUGINS_FOLDER%/tests/*.xml. You can find them also in
https://github.com/hildogjr/KiCost/tree/master/tests or https://github.com/xesscorp/KiCost/tree/master/tests

Other tip, you can start KiCost just by
kicost
without any additional parameter and use the graphical interface to browse to the file.


#18

Thanks @hildogjr ! I saw that after I made the post.
KiCost seems to be working now after update, but only for farnell and digikey and to a lesser extent TME.
One other thing I noticed is that in libre office calc, the qty fields show 0 until you update board quantity.
This is a great starting point for me though. I really appreciate the tool, bravo!


#19

I also use LibreOffice, it is its issue. Go to Tools>>Options>>LIbreOffice Calc>>Formula>>Recalculation on File Load
and adjust it.

Also, on GUI now (beta feature) there is an option “convert do ODS” if LibreOffice recognized on the OS.