Async client for the Anycubic Cloud API and its MQTT stream
Project description
anycubic-cloud-api
Async Python client for the Anycubic Cloud API and its MQTT telemetry stream.
Extracted from the Home Assistant Anycubic integration so it can be versioned, tested and used independently.
Attribution
The bulk of this library is the work of @WaresWichall, from hass-anycubic_cloud — the Anycubic cloud API client, the MQTT layer and the printer data models all originated there, under GPL-3.0.
This package extracts that code so it can be versioned and tested on its own, and adds to it: the LAN Mode client, the filament-usage maths, tolerant parsing of partial reports, and the test suite. Those additions and modifications are by @Nino6689, from 2026 onwards.
It remains GPL-3.0-or-later, as it must.
Anycubic's certificates
This package ships Anycubic's own TLS certificates and client key, because their MQTT broker requires mutual TLS using that identity and there is no other way for a third-party client to reach it. They are Anycubic's property, not covered by this licence, and no ownership is claimed — see COPYRIGHT. They are a shared identity taken from Anycubic's own slicer rather than a per-user credential, and they came from the upstream project this is derived from.
The LAN Mode client needs none of this. If you only talk to the printer locally, no Anycubic credential is involved at any point.
Install
pip install anycubic-cloud-api
Use
import aiohttp
from anycubic_cloud_api import AnycubicMQTTAPI, AnycubicAuthMode
async with aiohttp.ClientSession() as session:
api = AnycubicMQTTAPI(session=session)
api.set_authentication(auth_token="eyJ...", auth_mode=AnycubicAuthMode.SLICER)
if await api.check_api_tokens():
for printer in await api.list_my_printers():
print(printer.name, printer.current_status)
Authentication
Anycubic's login is captcha- and 2FA-protected, so there is no automated sign-in: you supply a token obtained from the Anycubic slicer, website, or Android app. Slicer tokens are 90-day JWTs and additionally unlock the MQTT stream; web tokens are polling-only.
TLS
The MQTT broker requires mutual TLS using Anycubic's own certificates, which ship inside this package. The client verifies the broker against Anycubic's pinned root CA with hostname checking enabled. Two relaxations are unavoidable and forced by Anycubic's certificates:
- their client certificate is SHA-1 signed, so OpenSSL 3.x will not load it at the default security level
- their root CA omits the
keyUsageextension, which Python 3.13+ rejects as a trust anchor underVERIFY_X509_STRICT
Neither weakens chain or hostname verification.
Licence
GPL-3.0-or-later, matching the integration it came from.
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
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 anycubic_cloud_api-0.4.7.tar.gz.
File metadata
- Download URL: anycubic_cloud_api-0.4.7.tar.gz
- Upload date:
- Size: 103.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fd2caef99f95796eed978f2adff8500e4b6df125d0fd8430e947578a93a1d24
|
|
| MD5 |
7499b4c997bcafc241ff69c0a51b7121
|
|
| BLAKE2b-256 |
c7c4c210a4bc6eb36417b667a30dafa3abf655d7196f43bbb5cd43f46cf204b1
|
File details
Details for the file anycubic_cloud_api-0.4.7-py3-none-any.whl.
File metadata
- Download URL: anycubic_cloud_api-0.4.7-py3-none-any.whl
- Upload date:
- Size: 97.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62702de165a37d7d513a258b13399224aeac7efdc5007a282465e9faf2bec44d
|
|
| MD5 |
017fea1ac144bc369a0f249143368fe2
|
|
| BLAKE2b-256 |
736de1e3dce5fe6db3e4b1827d47cf97f298c29ddb9c9d48012ef4afdbe1568a
|