Tags

,

Today I worked on the makeDigikeyBOM.py tool.  I like evolving “quicky” tools I wrote.  In this case, it is a tool that gets component information from the (Kicad) eeSchema file, scrapes the Digikey site to get pricing information, and then creates a CSV with BoM information.  I posted about this tool in several posts including this one.  The challenge I have is I’m not fluent in Eclipse (the IDE I use), Python, or the innards of XML.  This means my progress is M-U-C-H slower than if I had a clue.  On the positive note, each time I come back to Eclipse/Python/innards of XML it takes me less time to get up to speed than it did the previous time.

I worked on cleaning up the python code – adding robustness and a new feature.  The new feature supports a component that is in eeSchema to be ignored when creating the Bom.  If the PN field equals X or x, the python script will remove that component (in Beautiful Soup speak – extract) from the outputted BoM (GitHub location).

I have a bit more to do with clean up.  When I ran the script on the Sensor Puck eeSchema (see Kicad and MakeDigikeyBoM files for the Sensor Puck at this GitHub location), most of the price fields weren’t filled in:

Reference Value Quantity Manf Part # Digikey Part # 1 10 100 1000 Qty Avail Link  
C2 4.7u 1 LMK212BJ475KD-T 587-1297-2-ND 0 0 0 0   http://www.digikey.com/product-detail/en/taiyo-yuden/LMK212BJ475KD-T/587-1297-2-ND/930649  
R7 100K 1 ERJ-6GEYJ104V P100KATR-ND 0 0 0 0   http://www.digikey.com/product-detail/en/panasonic-electronic-components/ERJ-6GEYJ104V/P100KATR-ND/83110  
U1 Si7006 1 SI7006-A20-IM 336-3124-ND 2.08 2.08 1.7372 1.56551   http://www.digikey.com/product-detail/en/silicon-labs/SI7006-A20-IM/336-3124-ND/5050329  
R5,R6 4K7 2 RC0805FR-07100KL 311-100KCRTR-ND 0 0 0 0   http://www.digikey.com/product-detail/en/yageo/RC0805FR-07100KL/311-100KCRTR-ND/727544  
R4,R1,R2,R3 10K 4 C0805JR-0710KL 311-10KARTR-ND 0 0 0 0   http://www.digikey.com/product-detail/en/yageo/RC0805JR-0710KL/311-10KARTR-ND/728241  
C1 .1u 1 CL21F104ZBCNNNC 1276-1007-2-ND 0 0 0 0   http://www.digikey.com/product-detail/en/samsung-electro-mechanics-america-inc/CL21F104ZBCNNNC/1276-1007-2-ND/3886665  
U2 CCS811 1 CCS811CT-ND CCS811CT-ND 15.5 12.65 9.8038 9.8038   http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CCS811CT-ND  
R8 NTC100K 1 NTCS0805E3104FXT BC2562TR-ND 0 0 0 0   http://www.digikey.com/product-detail/en/vishay-bc-components/NTCS0805E3104FXT/BC2562TR-ND/2237371  

Open Source

I updated the makeDigikeyBOM (GitHub location)  project to reflect the changes made for this post.

Upgrade Eclipse

I like Eclipse for this project.  Eclipse has a great debugger, manages files well, and has great Python support through PyDev.  At this point, I run makeDigikeyBOM.py ONLY within Eclipse.

I’m not surprised that upgrading Eclipse was more complex than hitting some “START” button.  I installed Eclipse when I was coding for the nRF51 SDK.  The first thing I’ll do is update to the neon version.  The steps I took to upgrade include:

    • Install the latest version of Eclipse from here.  While installing, I got the dialog box:

NewImage

I’ve been ignoring updating the Java VM on my Mac. I go to Oracle’s page for downloading the JVM and install the JRE for OSX.  Ignoring the warnings:

NewImageChecking the Java icon within System Preferences:

NewImage

I’m told I have the most current version of Java installed.  Yet I still got the same message when installing Eclipse.  What gives?  Turns out Eclipse requires the JDK (would be nice if the Eclipse install let us know!)…So I went back to Oracle’s Java downloads and installed the OS X version of the Java Development Kit.

The Eclipse Installer opens open with a cacophony of choices:

NewImage

There isn’t one for Python so I installed the C/C++ option.

  • Put the folder’s path of the workspace where my code for the MakeDigikeyBoM is kept.

This brings up the warning dialog box about upgrading the files to work with neon:

NewImage

Which true to my character, I ignore.

Ooh…awesome..the spiffy Neon update of Eclipse opens…but…

NewImage

I go into Help->Install Software menu and install PyDev.  I choose not to install Mylyn for now.

NewImage

And FINALLY!  Oh…about an hour and a half later…I’m in the latest, greatest Eclipse IDE customized with PyDev…VROOM, VROOM!

Updating The Code

I haven’t looked at the makeDigikeyBOM.py tool since I wrote posts about it (including this one).  On top of that, I’m not that fluent with Python – or the other skill I need – the innards of XML.  There is a sense of thrill though to be able to evolve and just believe I’ll make progress.  And I did.  The code is a bit more robust.  Also, I added the ability to ignore a component by setting the PN value to ‘X’ or ‘x’.  The MakeDigikeyBOM GitHub project location is here.  As I noted at the start of this post, there is still work to do.  That will wait for another day. 

Advertisements