Skip to main content

Python display framework for Raspberry Pi, currently focused on SSD1306 and SH1106 OLEDs

Project description

rpi-display-core

rpi-display-core is a Python display framework for Raspberry Pi projects.

Today it supports SSD1306 and SH1106 OLED displays through dedicated backends under rpi_display.displays, while keeping the shared drawing and widget framework generic.

Install

From the repository

git clone https://github.com/andremmfaria/rpi-display-core.git
cd rpi-display-core
uv sync

From PyPI

uv add rpi-display-core

Import it as:

from rpi_display import Runner, canvas
from rpi_display.displays.ssd1306 import SSD1306Display

What it provides

  • rpi_display.displays.ssd1306.SSD1306Display — SSD1306 display wrapper for Raspberry Pi
  • rpi_display.displays.sh1106.SH1106Display — SH1106 display wrapper for Raspberry Pi
  • canvas(display) — context manager that creates a fresh PIL image and flushes it on exit
  • Runner — simple fixed-FPS render loop
  • MockDisplay — hardware-free test helper
  • Built-in widgets for text, progress bars, clocks, network info, system stats, and spinners

Quick example

from rpi_display import Runner
from rpi_display.displays.ssd1306 import SSD1306Display
from rpi_display.widgets.clock import ClockWidget

Runner(SSD1306Display(), ClockWidget(), fps=1).run()

Display integrations

from rpi_display.displays.ssd1306 import SSD1306Display
from rpi_display.displays.sh1106 import SH1106Display

Other display chips can follow the same pattern under rpi_display.displays.

Widget modules

from rpi_display.widgets.text import Text, MultiLineText, ScrollingText
from rpi_display.widgets.shapes import ProgressBar
from rpi_display.widgets.clock import ClockWidget
from rpi_display.widgets.system import SystemStatsWidget
from rpi_display.widgets.network import NetworkWidget
from rpi_display.widgets.spinner import Spinner

Examples

The repository includes ready-to-run examples in examples/:

  • 01_hello_world.py
  • 02_system_stats.py
  • 05_animation.py
  • 07_clock.py
  • 09_systemd_service.py
  • 10_sh1106_system_stats.py

Raspberry Pi setup

For wiring, I2C enablement, uv-based setup, and systemd instructions, see SETUP.md.

Development workflow

uv sync
uv run pytest
uv run ruff check .
uv run black --check .
uv run isort --check-only .
uv run mypy

Build and validate for PyPI

uv build
uvx twine check dist/*

Publish

uv publish

Current scope

  • Raspberry Pi focused
  • SSD1306 and SH1106 support implemented today
  • Architecture intended to grow to more display types later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpi_display_core-1.1.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpi_display_core-1.1.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file rpi_display_core-1.1.2.tar.gz.

File metadata

  • Download URL: rpi_display_core-1.1.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rpi_display_core-1.1.2.tar.gz
Algorithm Hash digest
SHA256 76bfa68dc8d38be2720594ede3c6bb10ce34e37986b68ec5b99942e9fc3911b8
MD5 17e40c66f79beefe28343e254dbf9064
BLAKE2b-256 caa244c7eae26ac0ca671ef5dc9068d721f2e2b90ac143b4b32797996a75eedf

See more details on using hashes here.

Provenance

The following attestation bundles were made for rpi_display_core-1.1.2.tar.gz:

Publisher: publish.yml on andremmfaria/rpi-display-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rpi_display_core-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for rpi_display_core-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b9de476338e1b0d646c9901803faebda40e608af787a142d829352e578e2922a
MD5 9224d11d16338ea32525e1ab9c79eda9
BLAKE2b-256 45e18ab3db063144d84775f21611ffa13af43f97c709ab780c8b1031b481abe2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rpi_display_core-1.1.2-py3-none-any.whl:

Publisher: publish.yml on andremmfaria/rpi-display-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page