Signing URLs in Python

Hello,

I am trying to sign my video URLs in Python, but the example given to do this is in JS. I am not familiar enough with JS so I am not sure how to convert the example code. Has anyone done this in Python before?

Reference article: https://developers.cloudflare.com/stream/viewing-videos/securing-your-stream#step-2-generate-tokens-using-the-key