
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
This package provides a Python API for interacting with BambuLab 3D Printers. The API enables you to control and monitor your printer programmatically, making it an essential tool for developers, makers, and automation enthusiasts. The project is open-source and available on PyPI.
If you've found this package useful, help us support more printers with the link below.
Comprehensive documentation for this package, including API reference and usage guides, can be found here.
To install the package, use pip
:
pip install bambulabs_api
Make sure you have Python 3.6 or higher installed.
Below is a basic example demonstrating how to connect to a BambuLab 3D printer and retrieve its status using the API:
import time
import bambulabs_api as bl
IP = '192.168.1.200'
SERIAL = 'AC12309BH109'
ACCESS_CODE = '12347890'
if __name__ == '__main__':
print('Starting bambulabs_api example')
print('Connecting to BambuLab 3D printer')
print(f'IP: {IP}')
print(f'Serial: {SERIAL}')
print(f'Access Code: {ACCESS_CODE}')
# Create a new instance of the API
printer = bl.Printer(IP, ACCESS_CODE, SERIAL)
# Connect to the BambuLab 3D printer
printer.connect()
time.sleep(2)
# Get the printer status
status = printer.get_state()
print(f'Printer status: {status}')
# Turn the light off
printer.turn_light_off()
time.sleep(2)
# Turn the light on
printer.turn_light_on()
# Disconnect from the Bambulabs 3D printer
printer.disconnect()
If you want to contribute to the development of this API or run it in a development environment, follow these steps:
Clone the repository:
git clone https://github.com/mchrisgm/bambulabs_api.git
Change directory:
cd bambulabs_api
Create the Conda environment using the provided environment.yml
file:
conda env create -f environment.yml
Activate the environment:
conda activate bl_api
Install the package in development mode:
pip install -e .
To ensure everything is working correctly, you can run the tests using pytest
:
pytest
Contributions are welcome! If you'd like to contribute to this project, please:
git checkout -b feature-branch
).git commit -am 'Add new feature'
).git push origin feature-branch
).Please make sure your code follows PEP 8 guidelines and that you run tests before submitting a PR.
This project is licensed under the MIT License. See the LICENSE file for more details.
If you encounter any issues or have questions, feel free to open an issue on the GitHub repository.
This package is an open-source project developed and maintained by the community. Special thanks to all contributors who have helped improve and enhance this API.
FAQs
API for BambuLab 3D Printers over MQTT
We found that bambulabs-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.