Skip to main content

bambu.local

Talk to a Bambu Lab printer over your own network, with no cloud account and no dependencies.

pip install bambu-local
import bambu_local as bambu

serial, code = bambu.credentials()          # the pair Bambu Studio saved, or pass your own
state = bambu.report("192.0.2.10", serial, code)
print(state["print"]["gcode_state"])        # IDLE, RUNNING, PAUSE, FINISH or FAILED

bambu.upload("192.0.2.10", code, "card.gcode.3mf")   # shows on the printer's screen, starts nothing
print(bambu.files("192.0.2.10", code))

The access code is on the printer's screen under its network settings.

What it does

  • report(host, serial, code) asks the printer for its whole state over MQTT on port 8883.
  • command(host, serial, code, payload) sends one command. It does not confirm the command worked, so read report afterwards and compare.
  • upload, files and delete use the printer's storage over implicit FTPS on port 990. upload checks that the printer lists the file at the same size.
  • credentials(conf=None) reads the first serial and access code from Bambu Studio's configuration file.

What it does not do

It holds no session, so it has no keepalive and no reconnect. It speaks MQTT at QoS 0 only. It is not a general MQTT or FTP library.

The printer's certificate cannot be checked against a public authority, so the connection protects the access code from a passive listener only. Use it on a network you trust.

On macOS

macOS can refuse a program access to the local network with [Errno 65] No route to host, while other programs on the same Mac reach the printer. If ping answers and Python does not, look at Privacy & Security, Local Network in System Settings.

Tested with

A Bambu Lab X2D. Other models use the same ports, but only this one has been tried.

Metadata

Release files for bambu-local 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bambu-local 0.1.0
File Size Uploaded Provenance Actions
bambu_local-0.1.0.tar.gz 9.9 kB With provenance Details for bambu_local-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bambu-local 0.1.0
File Interpreter ABI Platform Actions
bambu_local-0.1.0-py3-none-any.whl Python 3 none any Details for bambu_local-0.1.0-py3-none-any.whl

Total release size: 18.9 kB

Release files / bambu_local-0.1.0.tar.gz

Download URL bambu_local-0.1.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d326852802e9b25028b235be997df44c9f89e1af1e6612394e35765fe7a961f3
BLAKE2b-256 checksum
How to use checksums
1c9bafdf0ee10407bbcce6bf982803c8cc6fb85a6d28535c066e059dd6408ee5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / bambu_local-0.1.0-py3-none-any.whl

Download URL bambu_local-0.1.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b680d37bf049f18a95aed00cc4ec49359b9ce2bfc8b4c6d8f60ad9b753ff538
BLAKE2b-256 checksum
How to use checksums
3daa6af055b20e795d0e0957d3a9322057e2291455b86c008717f24c5145f820
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for bambu-local 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bambu_local-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page