Skip to main content

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 (printerStates collection)
  • Print job tracking via toyPrints collection
  • 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


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.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toybox_3d_api-0.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file toybox_3d_api-0.1.0.tar.gz.

File metadata

  • Download URL: toybox_3d_api-0.1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.9

File hashes

Hashes for toybox_3d_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e9bc801e292663a578e8f1f68736cf3248e5087c532622b48768494bc72da326
MD5 6555db35153dfad3b04c6b5e5866d4df
BLAKE2b-256 550fb43d688e47faa00ffffbc313aee6df3c78d933c8c5a45e226c23c98a2f0f

See more details on using hashes here.

File details

Details for the file toybox_3d_api-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: toybox_3d_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.9

File hashes

Hashes for toybox_3d_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a4cee714863d73eb966d060adb6ac4d6e8695a0a689ba90c2d1a1c34072948d
MD5 fe53f20e1bb3358356bc1fbbd29aaf98
BLAKE2b-256 df2879487158271795be40d5784c2bf70d09b13bd829f78b6734e233c77e0937

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page