Package: inventree-kicad-plugin
InvenTree KiCad - HTTP Library PluginA KiCad Conform API endpoint plugin, designed for integration withInvenTree, empowers users to seamlessly incorporate InvenTree parts into KiCad's parts library tool. Please note that this plugin exclusively offers metadata and necessitates the presence of corresponding symbol and footprint libraries within the KiCad EDA environment.As of the current stage of development, KiCad exclusively offers read-only access to parts through the HTTP lib interface.However, this plugin provides a metadata import tool to import changes made within KiCad. This enables users to add footprints, symbols and datasheets to individual parts during the schematic design process if not already available and re-import that information into InvenTree to have it available for the next time.Installing the PluginThere are several methods available for installing this plugin. To gain a comprehensive understanding of the installation process, please refer to theInvenTree - Installing a Plugin Guide. Depending on your preferred approach, the following instructions will provide you with the necessary information.Prior to plugin installation, ensure that you've activated bothURL IntegrationandApp Integration. You can accomplish this by going to Settings → Plugin Settings → Plugins. Additionally, if you're operating within a Docker environment, be sure to enableCheck plugins on startupas well.Through GitHubNavigate to thePlugin Settingsand click on the Install Plugin button. This will trigger a new window to appear, prompting you to enter the following information:Package Name: inventree-kicad-pluginSource URL: git+https://raw.githubusercontent.com/afkiwers/inventree_kicad/main/inventree-kicad-pluginThrough PiPThe plugin can be found here:inventree-kicad-plugin.Package Name: inventree-kicad-pluginIMPORTANT: Remember to restart your server and run the migrate command to implement the model changes required for this plugin. Failure to do so may result in the plugin encountering issues and not functioning correctly.Configure Plugin SettingsAfter installing the plugin, head over to the Plugin Settings and activate it. Look forKiCadLibraryPluginin the list of available plugins.Once activated, you'll see a new pluginKiCad Library Endpointon the left hand side. Click on it to open the plugin and proceed with the setup process.Adding Categories to KiCadNavigate to the admin backend, and scroll down until you find theINVENTREE_KICADsection. Within this section, click onKiCad Categories.
If the section is not visible, ensure you've enabled the "Enable URL integration" and "Enable app integration" options in the Plugin Settings and run a database migration.Once opened the "KiCad Categories" model, you'll have the option to add new categories which, once added, will be visible in KiCad's Symbol Chooser dialog.Default Settings for CategoriesThe plugin allows you to set default values when the child part lacks specific details regarding the KiCad symbol, footprint, or reference. This feature is particularly useful when dealing with components such as resistors or capacitors, as they often share the same symbols, reducing the need for repetitive data entry.Utilizing Footprint Parameter MappingIf you have existing Footprint/Package Type parameters assigned to your components and prefer not to define a separate KiCad Footprint Parameter for them, you can leverage the Footprint Parameter Mapping functionality to establish a connection to KiCad Footprint names. Simply incorporate the desired mappings into the KiCad category:Additionally, you can combine this with the per-category "Footprint Parameter Template" override to utilize a different parameter for mapping purposes.Creating User Access TokensReturn to the administrative backend, navigate to the USER model, and access API Tokens. Select "ADD API Token" to generate a token designated for a specific user. It's crucial to highlight the importance of creating separate tokens for each user, rather than using a universal token for everyone.KiCad Configuration filesBelow is an example config which should help you get started reasonably quickly. The only thing needed here is to replacehttp://127.0.0.1:8000with your server's InvenTree URL, and replace usertokendatastring with a valid token. Save it as a file with.kicad_httplibextension, as specified in thepreliminary KiCad docs. To use it, add it as a symbol library inside KiCad.Please Note: The config file does not contain any part or category information. It merely tells KiCad what API to expect, what token to use and where to find it.{"meta":{"version":1.0},"name":"KiCad HTTP Library","description":"A KiCad library sourced from a REST API","source":{"type":"REST_API","api_version":"v1","root_url":"http://127.0.0.1:8000/plugin/kicad-library-plugin","token":"usertokendatastring"}}Add the HTTP library to KiCadInside KiCad's project manager, navigate toPreferences -> Manage Symbol Librariesand click on it. Add a GLobal Library by pressing the folder in the bottom left corner.When choosing the.kicad_httplibfile, KiCad will automatically detect that it is a HTTP lib file and only a Nickname needs to be set.It's recommended to put a#as prefix to make sure it is at the top of the list. Otherwise one might end up scrolling a lot.Use in KiCadOnce everything has been configured properly, KiCad should be able to display all the categories and parts using the Symbol Picker.Inside the schematic, one can either use the shortcut and pressAor navigate to the ribbon at the top and pressPlace -> Add Symbol.The Symbol Chooser should open up and display the parts sourced from InvenTree.Importing Metadata from Previous ProjectsSince KiCad does not offer a way to push information back to the server, InvenTree needs to have all that metadata such as footprints and symbols added manually. This can be very tedious, especially when there are thousands of parts.This plugin's import tool uses KiCad's intermediate file which is created whenever there is a BOM export. This file contains all the project's data which is needed.