{"id":21589,"library":"moonraker-api","title":"Moonraker API Client","description":"Async websocket API client for Moonraker, the Klipper 3D printer backend. Provides both HTTP and WebSocket interfaces for printer control and monitoring. Current version 2.0.6, updated August 2024.","status":"active","version":"2.0.6","language":"python","source_language":"en","source_url":"https://github.com/cmroche/moonraker-api","tags":["moonraker","klipper","3d-printing","websocket","async"],"install":[{"cmd":"pip install moonraker-api","lang":"bash","label":"Latest release"}],"dependencies":[{"reason":"Used for HTTP requests and WebSocket connections","package":"aiohttp","optional":false}],"imports":[{"note":"Old import path before package rename","wrong":"from moonraker import MoonrakerAPI","symbol":"MoonrakerAPI","correct":"from moonraker_api import MoonrakerAPI"}],"quickstart":{"code":"import asyncio\nfrom moonraker_api import MoonrakerAPI\n\nasync def main():\n    api = MoonrakerAPI(\"ws://192.168.1.100:7125/websocket\")\n    await api.connect()\n    print(await api.get_server_info())\n    await api.disconnect()\n\nasyncio.run(main())","lang":"python","description":"Create an async client connecting to a local Moonraker instance via WebSocket."},"warnings":[{"fix":"Remove references to WEBSOCKET_STATE_READY; use async connect() instead","message":"Since v2.0.0, MoonrakerAPI no longer uses WEBSOCKET_STATE_READY constant. State management changed.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use await api.connect() instead of synchronous call","message":"In v2.0.0, the connect() method became async and now blocks until the connection is ready.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Increase the receive timeout via aiohttp ClientTimeout or patch if needed","message":"WebSocket receive timeout was added in v2.0.3; slow printers may cause timeout errors.","severity":"gotcha","affected_versions":">=2.0.3"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from moonraker_api import MoonrakerAPI'","cause":"Using wrong import name; the package is 'moonraker-api' but import is from 'moonraker_api'.","error":"ModuleNotFoundError: No module named 'moonraker'"},{"fix":"Remove usage of WEBSOCKET_STATE_READY; rely on async connect()","cause":"Removed in v2.0.0 breaking change.","error":"AttributeError: module 'moonraker_api' has no attribute 'WEBSOCKET_STATE_READY'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}