Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
April 27, 2021 14:42
November 1, 2021 18:18
September 17, 2019 14:11
September 17, 2019 14:11
September 17, 2019 14:11
March 29, 2021 12:12
November 2, 2021 14:37

Python ST7789

Build Status Coverage Status PyPi Package Python Versions

Python library to control ST7789 TFT LCD displays.

Designed to work with the following Pimoroni ST7789 based SPI breakouts and Raspberry Pi HATs:

Photo showing four different Pimoroni ST7789-based products


First, make sure you have the following dependencies:

sudo apt update
sudo apt install python3-rpi.gpio python3-spidev python3-pip python3-pil python3-numpy

Install this library by running:

sudo pip3 install st7789

You will also need to make sure I2C and SPI are enabled in raspi-config (sudo raspi-config) - you can find them under Interface Options.


You can find some examples of use in the examples folder. Clone this repo with:

git clone

and navigate into the examples folder with:

cd ~/st7789-python/examples/

You can pass most of them a parameter (square, rect, round, or dhmini) to specify the size/shape/rotation of screen, like this:

python3 dhmini

Licensing & History

This library is a modification of a modification of code originally written by Tony DiCola for Adafruit Industries, and modified to work with the ST7735 by Clement Skau.

To create this ST7789 driver, it has been hard-forked from st7735-python which was originally modified by Pimoroni to include support for their 160x80 SPI LCD breakout.

Modifications include:

  • PIL/Pillow has been removed from the underlying display driver to separate concerns- you should create your own PIL image and display it using display(image)
  • width, height, rotation, invert, offset_left and offset_top parameters can be passed into __init__ for alternate displays
  • Adafruit_GPIO has been replaced with RPi.GPIO and spidev to closely align with our other software (IE: Raspberry Pi only)
  • Test fixtures have been added to keep this library stable

Pimoroni invests time and resources forking and modifying this open source code, please support Pimoroni and open-source software by purchasing products from us, too!

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Modified from 'Modified from 'Adafruit Python ILI9341' written by Tony DiCola for Adafruit Industries.' written by Clement Skau.

MIT license, all text above must be included in any redistribution