I know these layouts have two-letter codes like
us for the US layout. I need a list of all the layouts available and also to pair the two-letter codes to the proper names of the layout to get the not so trivial ones.
Open a text editor. Copy the code from the stackoverflow question mentioned in the comment to the file. Save the file with the name "getkbdlayouts.py".
Then open a console window. In that window, type
You may get an error like
I'm not sure why you'd need a full blown
to get the layouts list: