Great introduction to Python scripting in KiCad from Maciej ‘Orson’ Suminski:
The Python scripting interface in KiCad is a powerful tool that can relieve you from repetitive and tedious tasks. It is also a great method to address issues that are specific to your workflow and are not likely to be solved in the upstream code. In this talk, I will show you how to start your scripting adventure with KiCad by explaining the principles of python scripting and exploring a few examples. Do not be afraid…pythons are not venomous.