moonraker-api
Async websocket API client for Moonraker
What it is and what it does
moonraker-api is a fully asynchronous Python client for Moonraker, a control API commonly used in printer systems. It handles WebSocket connections and subscriptions to real-time state updates without requiring polling loops. The package uses aiohttp and async-timeout as its only runtime dependencies, making it lightweight and suitable for integration into async Python applications.
You instantiate a MoonrakerClient with a listener object implementing MoonrakerListener, then call connect() to establish the WebSocket link. Once connected, you can issue one-off requests or subscribe to push notifications through callback methods. The listener pattern lets your code react to state changes, exceptions, and incoming notifications asynchronously, making it natural to embed in event-driven systems.
Use it for:
- Monitor real-time printer status and state updates from a system via WebSocket subscriptions.
- Build integrations or custom dashboards that react to printer state changes without polling.
- Send commands and query printer configuration through the Moonraker API from an async Python application.
- Handle authentication errors and connection state transitions in a listener-based event loop.
- Integrate printer telemetry into monitoring or logging systems that require non-blocking async I/O.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Fully async Python client for connecting to and subscribing to Moonraker's WebSocket API without polling, using aiohttp for network communication.
Yes, if you need to interface with Moonraker from Python. The package is actively maintained, has low install friction, and provides a clean async API. The GPLv3 copyleft license requires any derivative work to remain open-source, so verify that constraint fits your use case. No known vulnerabilities as of 2026-08-14.
Install
moonraker-api on PyPI
pip
pip install moonraker-apiuv
uv add moonraker-apipoetry
poetry add moonraker-apiInstalling moonraker-api
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with last commit on 2026-08-12; requires Python 3.10 or later.
License in practice
Licensed under GPLv3 (copyleft). Any derivative work or distribution must also be open-source under GPLv3; proprietary use is not permitted.
Quickstart
pip install moonraker-api
from moonraker_api import MoonrakerClient, MoonrakerListener
class MyListener(MoonrakerListener):
async def on_notification(self, method, data):
print(f"Notification: {method} -> {data}")
client = MoonrakerClient(MyListener(), HOST, PORT, API_KEY)
await client.connect()
response = await client.request("printer.info")
await client.disconnect()
Requires Python 3.10 or later; aiohttp and async-timeout must be installed as runtime dependencies.
Verify before relying
- Whether Moonraker server setup and network accessibility are prerequisites for testing this client.
- Performance characteristics under high-frequency subscription updates or large payloads.
- Backward compatibility guarantees across minor version updates.
Package facts
| License | not declared (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — aiohttp, async-timeout |
| Maintenance | actively maintained — 65 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 115,497/month — #12,249 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: moonraker_api-4.0.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
plexwebsocketAsync library that connects to Plex media…
permissive · top 15,000 on PyPI
python-kraken-sdkProvides REST and WebSocket clients for trading…
permissive · top 15,000 on PyPI
aioapnsaioapns sends push notifications to iOS devices…
permissive · top 5,000 on PyPI
websocketswebsockets is a library for building WebSocket…
permissive · top 100 on PyPI
agentmailAgentmail provides a Python client library for…
unclear · top 5,000 on PyPI
aioambientAn async Python library for querying Ambient…
permissive · top 15,000 on PyPI
uptime-kuma-api-v2Provides a Python client for the Uptime Kuma…
permissive · top 15,000 on PyPI
httpx-wsAdds WebSocket support to HTTPX, enabling sync…
permissive · top 5,000 on PyPI
winevtWinevt lets you query and subscribe to Windows…
permissive · top 15,000 on PyPI