from web3 import Web3
websocket_url='wss://api.chainup.net/ws/solana/mainnet/<YOUR_API_KEY>'
w3 = Web3(Web3.WebsocketProvider(websocket_url))
# You can check if the connection is established using isConnected function.
w3.isConnected()
# Output: True