--- id: moonraker-api version: "4.0.0" license: unclear license_treatment: copyleft maintenance: active --- # moonraker-api — Async websocket API client for Moonraker License: copyleft · Maintenance: active · Downloads: 115.5K/mo ## 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 above — 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 pip install moonraker-api uv add moonraker-api poetry add moonraker-api ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 115.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags moonraker websocket client, async printer api, moonraker api python, websocket subscription client, async event notifications, moonraker client library, websocket-client, async-io [View on SkillFed](https://skillfed.io/packages/moonraker-api) · [View on PyPI](https://pypi.org/project/moonraker-api/)