Pybricks Documentation

Pybricks is Python coding for smart LEGO® hubs. Run MicroPython scripts directly on the hub, and get full control of your motors and sensors.

Pybricks runs on LEGO® BOOST, City, Technic, MINDSTORMS®, and SPIKE®. You can code using Windows, Mac, Linux, Chromebook, and Android.

What’s on this page?

This page provides API documentation and short example snippets. If you’re new to Pybricks, or if you’re looking for bigger example projects, check out the Pybricks website instead.


Are you using LEGO MINDSTORMS EV3? Check out the EV3 documentation instead.


To run Pybricks MicroPython scripts, you must update the firmware on the hub. To get started, click one of the platforms below.

Technic Hub, City Hub, BOOST Move Hub

SPIKE Prime Hub / MINDSTORMS Inventor Hub


Once installed, Pybricks works the same for all hubs. check out the Pybricks modules in the left hand menu to see what you can do.

Get involved!

Got questions or issues? Please share your findings on our support page so we can make Pybricks even better. Thank you!