This repository contains the resources I used to create my own 0402 book of SMD resistors and capacitors. Similar to the 0603 and 0805 books sold by Adafruit.
The list of SMD components was created from my digikey order
The code in parse_capacitor_data.ipynb and parse_resistor_data.ipynb reads in the csv list of components, parses the description for the values and tolerances, creates a text label string, and then uses FPDF2 to create a pdf of labels which when printed align perfectly with the 8mm tape pages included in the SMT storage book.
The generated labels are then printed, cutout, and placed on the pages.
The provided code can be used with other parts, and extended to support others as well. Some improvements would be the following
- Use a LaTeX template for the labels instead of FPDF. It took several iterations of trial and error to get the spacing right using FPDF, because it doesn't support setting the row heights directly. However LaTeX does support this. I'm thinking a template LaTeX page could be made, with each label containing a string such as "C1R1L1" corresponding to column 1 row 1 line 1 which a Python script can search and replace with the component values. That way other formats of pages and storage media could be easily supported.
- Instead of using the provided description, include support for looking up part information using the manufacturer part number. This would require an API key for a distributor such as Digikey, but it would allow obtaining more part information and creating more detailed labels. Or including a scannable QR code to quickly reorder new parts.

