Need help with python scripting for kicad9

Kicad newb here… started a botu 2 weeks ago.
I have a PCB already laid out. its got about 800 parts. I just learned about LCSC part numbers, and how to include those in the BOM. I want to add the LCSC part numbers to the individual footprints. I started doing it manualy, but realized I saw a thing about a scripting tool so i checked that out. I can manage to list the parts, but I can figure out how to list the footprint properties. So I opened the project.kicad_pcb in a text editor to see if I could figure some other way to script the property tags.

From project.kicad_pcb:


	(footprint "HXCFootprints:C_0603_1608Metric"
		(layer "F.Cu")
		(uuid "00000000-0000-0000-0000-0000642a636d")
		(at 250.95 84.45 -90)
		(descr "Capacitor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 76, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator")
		(tags "capacitor")
...
		(property "LCSC" ""
			(at 0 0 0)
			(unlocked yes)
			(layer "F.Fab")
			(hide yes)
			(uuid "212693e4-e4b0-4c3d-8afa-fd1639ad3136")
			(effects
				(font
					(size 1 1)
					(thickness 0.15)
				)
			)
		)

what I thought I might do was write a python or bash script to just add LCSC “” property tags though out the document at the relevant locations, but now I’m tripping over this uuid attribute which I don’t know how to generate or deal with.

what I really need is a tutorial or something on how to use the scripting tool, and how to make changes to the footprints. I tried reading the API, but IDK, I’m kinda confused by that too. I looked at MAP_STRING, FOOTPRINTS, GetFootprint(), setProperty, SetProperties() and a variety of other functions, but man, i cant figure it out.

https://docs.kicad.org/doxygen-python-6.0/classpcbnew_1_1BOARD.html#afa4a58cb1cc05f74ae043cbd28fb42c6

is there a tutorial or something to walk me thought the kicad scripting?
how is the uuid property determined?

I believe if you did a Python script to add your LCSC property field on your kicad_sym parts, you’ll find they don’t have the UUID entry. I believe that gets added uniquely only when placed. If you edit your library symbols to add your new field, then do a global ‘update from library’ you shouldn’t need to be concerned with the UUID entry.

Following is a link to Python script that parses through all the parts in my kicad_sym library and adds a new field called Description2 with the same field data as the symbol name. After I run my script on my libraries and update my symbols to that edited library, all the symbols inherit the new property. I mostly used Grok AI to write this script but I did hand patch it a bit to produce correct results.