Sure PubSub is just a socket protocol to deliver data to you.
Since it’s Websockets led, it’s super easy to throw a javascript example up. Just like how Twitch Chat is available over A websocket, so if you can speak websocket you can use PubSub.
Some of the existing Twitch Python libraries probably have support, so use one of those or a Python WebSocket client