Build cost spreadsheet for a KiCad project.
KiCost is intended to be run as a script for generating part-cost spreadsheets for circuit boards developed with KiCad.
- Free software: MIT license
- Documentation: https://xesscorp.github.io/KiCost.
- Quick start: https://www.youtube.com/watch?v=AeccxROpDfY.
- Processes the BOM XML file from your KiCad schematic to create a part-cost spreadsheet by scraping the web sites of several popular distributors for price and inventory data. (You can also enter your own quantity-adjusted pricing data for specialized parts or those not found at the supported distributors.);
- Processes also BOM files from Altium, Proteus, Eagle, Upverter and hand made CSVs;
- The spreadsheet contains quantity-adjusted pricing from each distributor for individual parts and the total board;
- Enter the number of boards to be built in a spreadsheet cell and all the pricing for the total board and individual parts is updated;
- The spreadsheet also shows the current inventory on-hand for each part at each distributor;
- Enter the quantity of each part that you want to purchase from each distributor and lists of part numbers and quantities will appear in formats that you can cut-and-paste directly into the website ordering page of each distributor.
.. image:: block_diag.png
- Changed Farnell link and table result format.
- Fixed TME
- Re-factored the distributors modules to class kind and improved the scrape sequence to decrease probability of ban.
- Fixed the multi-threading configuration.
- Fixed Mac-OS hang when parallel scraping.
loggingmessages when using
tqdm(process bar) for sequential scrape, missing fix for multithreads scrape.
- Improve the
spreadsheet.pyto a lighter file when use just one distributor.
- Improved log messages to better community debug.
- Add Upverter CSV compatibility.
- Fixed Mouser "quote price" exception in the price tiers.
- Fixed wxPython exception import.
- Use the datasheet link information from KiCad and other EDAs, given by 'datasheet' field.
- Now automatically merge 'description' and other fields to create the groups.
- GUI save last position and size and others improvements.
- Display additional information from the web page distributors and use as comment in the
cat#column (just implemented on DigiKey yet).
- Now is possible to specify country/currency to be priorized on the distributors scrapes (just implemented on DigiKey yet).
- Minor improvements.
- Fixed RS scrape module.
--no_scrapeoption to create spreadsheets without information from distributor websites.
--no_collapseoption to prevent collapsing part references in the spreadsheet.
--throttling_delayoption to add delay between accesses to distributor websites.
--show_eda_listoption to display the list of EDA tools supported by KiCost.
- Added capability to read multiple BOM files and merge them into the spreadsheet.
--group_fieldsoption to ignore differences in fields of the components and group them.
- Fixed the not ungrouping issue when
- CSV now accepts files from Proteus and Eagle EDA tools.
- Cleared up unused Python imports and better placed functions into files (spreadsheet creation files are now in
- Added a KiCost stamp version at the end of the spreadsheet and file information in the beginning, if they are not inside it.
- Fixed issues related to user visualization in the spreadsheet (added gray formatted conditioning and the "exclude desc and manf columns").
- Added "user errors" and software scape in the case of not recognized references characters given the message of how to solve.
- Support for multiple quantity for a single manufacture code (before just worked when using multiple/sub-parts).
- Fixed the Altium EDA module.
- Created a graphical user interface based on wxWidgets (the dependence is asked to be installed at the first use).
- Added the
--useroption allow to use just
kicost --user -i %fileand others parameters will be got by the last configuration in the graphical interface (that save the user configurations).
- Added automatic recognition of the files of each EDA tool (for the graphical interface).
- Processing of CSV files containing part information is now supported.
show_dist_listoption to display the list of distributors from which part cost data is available.
- Added capability to process multiple XML and CSV files.
- Fixed exception caused by missing 'href' key in product links extracted by TME module.
- Fixed exceptions caused by .xml files without a title block or part library section.
- Part number separator characters can now be escaped with backslashes in case they are actually part of part numbers.
- Fixed webscrape retry error in TME distributor module.
- A part manf# field can now contain multiple subpart numbers. Each part number can be assigned a multiplier to indicate the quantity of the subpart needed for each part.
- Unit price cells for parts now show complete Qty/Price table as a cell comment.
- Part quantity cells are now color-coded to indicate parts with insufficient availability.
- Part quantity cells are now color-coded to indicate parts for which insufficient quantity has been ordered.
- Project name, company, and date are now shown in the spreadsheet.
- New distributor can now be added just by creating a submodule in
- Added distributor TME.
--retriesoption to set the number of attempts at loading a distributor webpage.
- Fixed problem where "kicost:dnp" field was not recognized.
- Parts may now be assigned to a variant by giving them a
- Parts may now be assigned to multiple variants.
- Parts may be designated as "do not populate" by giving them a
- DNP parts or parts not in the current variant will not appear in the cost spreadsheet.
- Fixed bug in scraping RS website when a part search results in a list of matches instead of a single product page.
- Fixed crash caused by uninitialized array in Digikey webscraping module.
- Place any available scraped part info into spreadsheet even if part is not available from a distributor.
- Removed unused imports from distributor modules.
- Surround worksheet name with quotes in case it contains spreadsheet operators.
- Fixed extraction of product links from Farnell product tables.
- Added options for including or excluding distributors.
- Updated web scrapers for various distributors.
- Added more debugging/logger statements.
- Updated some of the package requirements.
- Giacinto Luigi Cerone added support for distributors Farnell and RS.
- Manufacturer's part number field can now be labeled as 'manf#', 'mpn', 'pn', '#', etc. (See documentation.)
- Manufacturer field can now be labeled as 'manf' or 'manufacturer'.
- Distributor part number fields can now be labeled as 'digikey#', 'digikeypn', digikey_pn', 'digikey-pn', etc.
- KiCost no longer fails if the <libparts>...</libparts> section is missing from the XML file.
- Documentation moved to Github Pages.
- Fixed scraping of Digi-Key pages to correctly detect reeled parts and scrape alternate packaging options.
- Fixed scraping of Digi-Key pages to correctly extract available quantity of parts.
- Progress bar is explicitly deleted to prevent an error from occurring when the program terminates.
- Contents of "Desc" field in component/library were being ignored when generating spreadsheet.
- Fixed part scraping from Newark website.
- Added progress bar.
- Added quiet option to suppress warning messages.
- 'manf#' and 'manf' fields are now both propagated to similar parts.
- Extra part data can now be shown in the global data section of the spreadsheet
by using the new
--fieldscommand-line option. This commit implements issue #8.
- Parts with valid Digi-Key web pages were not appearing in the spreadsheet because they had strange quantity listings (e.g., input fields or 'call for quantities'. This commit fixes #36.
- Prices of $0.00 were appearing in the spreadsheet for parts that were listed but not stocked. Parts having no pricing list no longer list a price in the sheet.
- Parts with short manf. numbers (e.g. 5010) were not found correctly in the distributor websites. The manufacturer name was added to the search string to increase the probability of the search finding the correct part.
- Local parts weren't showing up in spreadsheet because of previous fix to omit parts that had no quantity field (non-stocked; not even 0). Fixed.
- Made change to adapt to change in Digi-Key's part quantity field of their webpages.
- Omit parts from the spreadsheet that are listed but not stocked at a distributor.
- Made changes to adapt to changes in Digi-Key's webpage format.
--variantcommand-line option for costing different variants of a single schematic.
--num_processescommand-line option for setting the number of parallel processes used to scrape part data from the distributor web sites.
--ignore_fieldscommand-line option for ignoring benign fields that might prevent identical parts from being grouped together.
- Fixed exception caused when indexing with 'manf#' on components that didn't have that field defined.
- Replaced custom debug_print() with logging module.
- When scraping a Digi-Key product list page, use both the manfufacturer's AND Digi-Key's number to select the closest match to the part number.
- 'kicost:' can be prepended to schematic field labels to distinguish them from other app fields.
- Custom prices and documentation links can now be added to parts in the schematic.
- Web-scraping for part data is sped up using parallel processes.
- Following the IP address mouser with redirect you to the nearest locale match, so the price will be in Euro if you are in Europe and the price decimal can be a comma.
- Changed BOARD_COST field to UNIT_COST.
- Changed formatting of UNIT_COST field to make use monetary units.
- Changed format of debug messages.
- Pushed lxml requirement back to 3.3.3 so linux mint would have fewer problems trying to install.
- Fixed exception caused by Digi-Key part with 'call' as an entry in a part's price list.
- Fixed extraction of part quantities in Mouser web pages.
- Added randomly-selected user-agent strings so sites might be less likely to block scraping.
- Added missing requirements for future and lxml packages.
- KiCost now runs under both Python 2.7.6 and 3.4.
- Mouser changed their HTML page format, so I changed their web scraper.
- Corrected entrypoint in main.py.
- Added conditional formatting to indicate which distributor had the best price for a particular part.
- Fixed calc of min unit price so it wouldn't be affected if part rows were sorted.
- Added global part columns that show minimum unit and extended prices for all parts across all distributors.
To reduce the effort in adding manufacturer's part numbers to a schematic, one will now be assigned to a part if:
#. It doesn't have one. #. It is identical to another part or parts which do have a manf. part number. #. There are no other identical parts with a different manf. part number than the ones in item #2.
- Fixed delimiter for Mouser online order cut-and-paste.
- First release on PyPI.