Any recommendation for a good tool (python/C or other script) to extract individual symbols from a library and also replace , remove or add individual symbols in a library , instead of using the Kicad GUI.
The libraries use S-expression format. The idea is to put symbol files under version control and not at the whole library level. We keep our own symbol folder for only the ones used in design so it much less than the whole Kicad repo.
From other discussions it seems there is not a plan to change to individual symbols files due to [1] load/save performance (Still wonder if hat is still an issue since even we have 500 MB/s SATA and 3000~7000 MB/Sec NVME now ) [2] symbols may depend and be derived from other symbols.
I am guessing that a CLI tool to split and merge symbol libraries into individual symbol files (and backward) would be less then a page long for any programming language that has a library for handling S-expressions.
I had a short peek at the user manual of kicad-cli, but it’s capabilities for symbol libraries seem to be limited at the moment. Apparently it can only export an svg version and update libraries from an older version.
Yes, Python has nice Search&Replace functions and implementation is not difficult. You can somewhat automate it for Kicad’s files (any file type, individual or multiple files).
I do it often enough that I wrote an App that has a GUI and is demoed in video below (used another users Step File posted issue for this show&tell). The App is specific to Mac (did not bother for Windows/Linux) so, you’re on your own…
The demo shows changing from default Step file to Colored Step file.
The Multiple radio-Btn will cause the change in All files in the selected Folder (including all subsequent embedded files/folders) so, it’s easy to change, for example, a “widget_Rev1” to “widget_Rev2”… etc The GUI has Pull-Down selection for items I typically need to tweak…