Python API client for ToyBox 3D printers (make.toys) via Meteor DDP
Project description
toybox-api — Python Client for ToyBox 3D Printers
Async Python client for ToyBox 3D printers via the make.toys Meteor DDP protocol.
Used by the Home Assistant integration.
Features
- Meteor DDP WebSocket client (no REST — make.toys is DDP-only)
- Authentication via Meteor accounts
- Real-time printer state via DDP subscriptions (
printerStatescollection) - Print job tracking via
toyPrintscollection - Time remaining / elapsed / progress calculations matching make.toys web app logic
Installation
pip install toybox-api
Usage
import asyncio
from toybox_api import ToyBoxClient
async def main():
async with ToyBoxClient() as client:
await client.connect()
await client.authenticate("email@example.com", "password")
await client.subscribe_to_printer_data(["printer_id"])
data = await client.get_all_data()
print(f"Printer: {data.printer.display_name}")
print(f"Online: {data.printer.is_online}")
print(f"State: {data.print_state}")
if data.current_request:
print(f"Printing: {data.current_request.print_name}")
print(f"Remaining: {data.current_request.remaining_seconds}s")
asyncio.run(main())
Data Model
| Class | Source | Description |
|---|---|---|
PrinterStatus |
printerStates collection |
Online state, model, hardware ID, firmware |
PrintRequest |
toyPrints collection |
Active/completed prints with timing data |
ToyBoxData |
Coordinator container | Combines printer + current/last print request |
Status
🟡 Beta — Implements real Meteor DDP protocol. Needs live testing with active prints.
Project Structure
ha-toybox/
├── toybox_api/
│ ├── __init__.py
│ ├── client.py # DDP WebSocket client
│ ├── models.py # PrinterStatus, PrintRequest, ToyBoxData
│ ├── exceptions.py # ToyBoxError hierarchy
│ └── const.py # DDP URLs, subscription/method names
├── pyproject.toml
├── LICENSE
└── README.md
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
toybox_3d_api-0.2.0.tar.gz
(14.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toybox_3d_api-0.2.0.tar.gz.
File metadata
- Download URL: toybox_3d_api-0.2.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eae37484dc63e1907aef10f0c9aa77965e228900ac2defd94192ddcf4dcf76b5
|
|
| MD5 |
56a27c29651d9cc820c0a0fa5e6801ee
|
|
| BLAKE2b-256 |
600ce0a8624d5b5ed86670b65802d16964ffe5ee5a2b829f474afbf80af1e65d
|
File details
Details for the file toybox_3d_api-0.2.0-py3-none-any.whl.
File metadata
- Download URL: toybox_3d_api-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbfbdedb32bf6b85a4aa0b23ab3237ce757203f618e5ee4b10666f36ec8214f1
|
|
| MD5 |
b05a6ffb4245c07a9e8190cfeff53f09
|
|
| BLAKE2b-256 |
3fd977c0a5c1c929f047f3e457b86a6c74f3cb90e57bc8fb6de8bde63cc25fd7
|