I had a similar problem and I found a handy list of pin mappings in the MCU database that comes with STM32CubeMX.
For your processor, it's installed in ./db/mcu/STM32L4R9V(G-I)Tx.xml. This file also has all the alternative functions for each pin which was useful during layout to optimize pin location vs. AF, since many AF's can appear in several locations. Some simple parsing will be needed, but the format is simple. The pin descriptions start at line 78 or so, and the "Position" value is the pin number.
I've attached the file from CubeMX 5.0.1 (that's old) to save you some time, and in case they don't provide this XML format anymore in the current tool.