KahootClient
is a Python client for connecting to Kahoot games using WebSockets. This package allows users to join a Kahoot game and send messages to the game server.
- Connect to Kahoot game servers.
- Handle session management and token decoding.
- Send and receive messages from the game server.
- Customizable logging for debugging purposes.
KahootConnect is a Kahoot API written in python, that Kahoot can't take down 🤡 #REForever
pip install -U KahootConnect
or clone the repo and
python3 -m pip install -e ./KahootConnect
First, you need to import the KahootClient
class from the package:
from kahoot_client import KahootClient
You can create an instance of the KahootClient
class with optional logging:
import logging
# Set up logging
logging.basicConfig(level=logging.DEBUG)
# Create a Kahoot client instance
client = KahootClient()
To join a Kahoot game, use the join
method, passing the game pin and your nickname:
import asyncio
async def main():
game_pin = "123456" # Replace with your game pin
nickname = "YourNickname" # Replace with your desired nickname
await client.join(game_pin, nickname)
# Run the async function
asyncio.run(main())
(DOCS) Need api docs?
(OUTDATED DOCS) Need api docs? More detailed docs?
The client uses Python's built-in logging module to provide debug information. You can configure the logging level to control the verbosity:
logging.basicConfig(level=logging.DEBUG) # Set to DEBUG to see all logs
The join
method may raise exceptions, particularly related to WebSocket connections. It's recommended to wrap your calls in try-except blocks to handle potential errors gracefully.
try:
await client.join(game_pin, nickname)
except Exception as e:
print(f"An error occurred: {e}")
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a pull request or open an issue if you find any bugs or have suggestions for improvements.