Registry / http-networking / moonraker-api

moonraker-api

JSON →
library4.0.0pypypi✓ verified 83d ago

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.

pip install moonraker-api
INSTALL
IMPORT
SIG · MOONRAKER-API
M
moonraker-api
http-networkingpythonv4.0.0
Install
3.9s avg
Import
Disk
27MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 27.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.9s · import 0.000s · 29MB
27MB installed
● package 27MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MoonrakerClient
from moonraker_api import MoonrakerClient
from moonraker_api import MoonrakerAPI
WebsocketClient
from moonraker_api import WebsocketClient
MoonrakerListener
from moonraker_api import MoonrakerListener

Create an async client connecting to a local Moonraker instance via WebSocket.

import asyncio from moonraker_api import MoonrakerAPI async def main(): api = MoonrakerAPI("ws://192.168.1.100:7125/websocket") await api.connect() print(await api.get_server_info()) await api.disconnect() asyncio.run(main())
Debug
Known issues
breakingSince v2.0.0, MoonrakerAPI no longer uses WEBSOCKET_STATE_READY constant. State management changed.
fix
Remove references to WEBSOCKET_STATE_READY; use async connect() instead
affects: >=2.0.0
breakingIn v2.0.0, the connect() method became async and now blocks until the connection is ready.
fix
Use await api.connect() instead of synchronous call
affects: >=2.0.0
gotchaWebSocket receive timeout was added in v2.0.3; slow printers may cause timeout errors.
fix
Increase the receive timeout via aiohttp ClientTimeout or patch if needed
affects: >=2.0.3
Upgrade
Version history
4.0.0latest on PyPI · released Jun 10, 2026
Audit
Dependencies
aiohttprequiredUsed for HTTP requests and WebSocket connections
Agent activity
4 hits · last 30 days
node
4
Resources
moonraker-api — pip install moonraker-api · libregistry