To speed up the building of this project, the packet format was taken from this post on the Codemasters forums.
Thanks to the hard work of the poster I was able to skip the tedious packet decoding.
pip install Telemetry-F1-2021
telemetry-f1-2021-recorder
from telemetry_f1_2021.listener import TelemetryListener
listener = TelemetryListener(port=20777, host='localhost')
packet = listener.get()