{"library":"mattermostdriver","title":"Python Mattermost Driver","description":"Mattermostdriver is a Python library providing a client for the Mattermost API. It enables developers to interact with Mattermost servers, manage users, channels, posts, and more. The current version is 7.3.2, and it maintains an active release cadence with regular updates and bug fixes.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install mattermostdriver"],"cli":null},"imports":["from mattermostdriver import Driver"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom mattermostdriver import Driver\n\n# Configure driver with environment variables or provide directly\ndriver = Driver({\n    'url': os.environ.get('MATTERMOST_HOST', 'localhost'),\n    'login_id': os.environ.get('MATTERMOST_LOGIN_ID', 'user@example.com'),\n    'password': os.environ.get('MATTERMOST_PASSWORD', 'yourpassword'),\n    'scheme': os.environ.get('MATTERMOST_SCHEME', 'https'),\n    'port': int(os.environ.get('MATTERMOST_PORT', 443)),\n    'verify': os.environ.get('MATTERMOST_VERIFY_SSL', 'true').lower() == 'true',\n    'token': os.environ.get('MATTERMOST_TOKEN', '') # Optional: for token-based auth\n})\n\ntry:\n    driver.login()\n    current_user = driver.users.get_current_user()\n    print(f\"Successfully logged in as: {current_user['username']} (ID: {current_user['id']})\")\n    # Example: Get system info\n    # info = driver.system.get_ping()\n    # print(f\"Mattermost Server Status: {info}\")\n\nexcept Exception as e:\n    print(f\"Login failed: {e}\")\nfinally:\n    if driver.is_connected():\n        driver.logout()\n        print(\"Logged out.\")\n","lang":"python","description":"This quickstart demonstrates how to initialize the `Driver`, log in using username/password (or token if provided via environment variable `MATTERMOST_TOKEN`), retrieve the current user's information, and then log out. Ensure your Mattermost server details and credentials are set as environment variables or passed directly to the Driver constructor.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}