pi-top Python SDK (Preview)
A simple, modular interface for interacting with a pi-top and its related accessories and components.
Supports all pi-top devices:
Supports pi-top Maker Architecture (PMA):
Supports all pi-top peripherals:
Status: Active Development
This SDK is currently in active development. Please be patient while we work towards v1.0.0!
Backwards Compatibility
When this library reaches v1.0.0, we will aim to maintain backwards-compatibility thereafter. Until then, every effort will be made to ensure stable support, but it cannot be guaranteed. Breaking changes will be clearly documented.
About
This SDK aims to provide an easy-to-use framework for managing a pi-top. It includes a Python 3 package (pitop), with several custom modules and classes for interfacing with a range of pi-top devices and peripherals. It also contains CLI utilities, to interact with your pi-top using the terminal.
The SDK is included out-of-the-box with pi-topOS.
Ensure that you keep your system up-to-date to enjoy the latest features and bug fixes.
This library is installed as a Python 3 module called pitop. It includes several submodules that allow you to easily interact with most of the hardware inside a pi-top.
You can easily connect different components of the system using the modules available in the library:
from time import sleep
from pitop import UltrasonicSensor, Miniscreen
utrasonic = UltrasonicSensor("D1")
miniscreen = Miniscreen()
while True:
miniscreen.display_text(utrasonic.distance)
sleep(0.1)
Check out the Overview chapter for more information on what you can do.
The SDK also contains a Command Line Interface (CLI). See the ‘pi-top’ command for more information.
Table of Contents
- 1. Getting Started
- 2. Overview
- 3. Key Concepts
- 4. Recipes
- 4.1. PMA: Using a Button to Control an LED
- 4.2. Robotics Kit: DIY Rover
- 4.3. Robotics Kit: Robot - Moving Randomly
- 4.4. Robotics Kit: Robot - Line Detection
- 4.5. Displaying camera stream in pi-top [4]’s miniscreen
- 4.6. Robotics Kit: Robot - Control using Bluedot
- 4.7. Using the pi-topPULSE’s LED matrix to show the battery level
- 4.8. Choose a pi-top [4] miniscreen startup animation
- 5. API - pi-top Device
- 6. API - pi-top Maker Architecture (PMA) Components
- 7. API - pi-top Peripheral Devices
- 8. API - System Peripheral Devices
- 9. Command-Line Tools (CLI)
- 10. 🧪 Labs - Experimental APIs ⚠️
- 11. More Information