I modified code from this repo: https://github.com/ztrayl3/PyPav2
The oAuth API sucks. These people managed to reverse engineer the BLE communications, and I slightly modified it to work for the newer Pavlok 3.