import logging import os logging.basicConfig( format="[%(asctime)s] [%(levelname)s] %(message)s", datefmt="%d.%m.%Y %H:%M:%S", level=logging.INFO ) from pyknuddels.classes.api import Knuddels from pyknuddels.classes.messages import Conversation, Message knuddels = Knuddels(os.environ["KN_USER"], os.environ["KN_PASSWORD"]) knuddels.login() conversations = knuddels.messenger_overview(1) for conversation in conversations: obj = knuddels.get_conversation(conversation["id"]) obj = Conversation.from_dict(conversation) print(obj)