To speed up the building of this project, the packet format was taken from this post on the Codemasters forums. Which oddly works for F1 22, which is nice.
Thanks to the hard work of the poster I was able to skip the tedious packet decoding.
pip install f1-22-telemetry
telemetry-f1-22-listener
from f1_22_telemetry.listener import TelemetryListener
listener = TelemetryListener(port=20777, host='localhost')
packet = listener.get()
pip install --upgrade build twine
python -m build
python3 -m twine upload f1-22-telemetry