Adafruit-PlatformDetect
Platform detection for use by libraries like Adafruit-Blinka.
What it is and what it does
Adafruit-PlatformDetect is a library that identifies what single-board computer or platform your code is running on by examining system files and Python's built-in platform info. It separates detection into two layers: chip identification (the processor itself) and board identification (the specific device model), since board detection often depends on knowing the chip first. The library gathers platform information from Linux system files like /proc/cpuinfo and /proc/device-tree/compatible, as well as board-specific sources like Beaglebone EEPROM IDs and distribution files.
It was originally written to support Adafruit_Blinka, a compatibility layer that lets CircuitPython code run on Linux single-board computers, but the detection logic is general enough to be useful in any project that needs to know what hardware it's running on. The library has no runtime dependencies and installs cleanly, making it lightweight for embedded and IoT use cases where you need to adapt behavior based on the detected platform.
Use it for:
- Detect Raspberry Pi model in a GPIO control library to apply model-specific pin mappings or timing adjustments.
- Identify Beaglebone Black in a hardware abstraction layer to load the correct device drivers.
- Adapt CircuitPython code to run on different single-board computers by detecting the platform at startup.
- Build cross-platform embedded applications that behave differently on Raspberry Pi, Orange Pi, or generic Linux PCs.
- Validate that a deployment is running on the expected hardware before initializing peripherals.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects the chip and board type of single-board computers and other platforms by reading system files and Python's sys.platform, primarily for use with Adafruit libraries.
Yes. The package is actively maintained, has no dependencies, installs with low friction, carries a permissive MIT license, and solves a real problem for anyone writing code that needs to adapt to different single-board computers. It has been stable since 2018 and is in production use. Install it if your project needs to detect or adapt to the underlying hardware platform.
Install
adafruit-platformdetect on PyPI
pip
pip install adafruit-platformdetectuv
uv add adafruit-platformdetectpoetry
poetry add adafruit-platformdetectInstalling Adafruit-PlatformDetect
Before you install
Low friction installation with no runtime dependencies. Active maintenance as of 2026-06-24 with a recent release 51 days ago.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open and closed projects.
Quickstart
pip install Adafruit-PlatformDetect
from adafruit_platformdetect import Detector
detector = Detector()
print(detector.chip.id)
print(detector.board.id)
Requires Python 3.7 or higher; platform detection relies on Linux system files (/proc/cpuinfo, /proc/device-tree/compatible, etc.) and will have limited functionality on non-Linux systems.
Verify before relying
- Whether the package successfully detects all advertised board models (Raspberry Pi, Beaglebone, Orange Pi, etc.) on current hardware.
- Performance impact of reading multiple system files during detection on resource-constrained single-board computers.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 51 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 158,724/month — #10,713 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: adafruit_platformdetect-3.89.1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
Adafruit-BlinkaAdafruit-Blinka emulates CircuitPython APIs on…
permissive · top 15,000 on PyPI
akracerAKRacer provides precompiled dynamic libraries…
permissive · top 5,000 on PyPI
py-cpuinfoDetects and reports CPU…
permissive · top 1,000 on PyPI
adafruit-circuitpython-busdeviceProvides I2CDevice and SPIDevice helper classes…
permissive · top 15,000 on PyPI
device-detectorParses user agent strings and client hints to…
unclear · top 15,000 on PyPI
adafruit-circuitpython-requestsA requests-like HTTP library for CircuitPython…
permissive · top 15,000 on PyPI
adafruit-circuitpython-typingProvides type annotation definitions for…
permissive · top 15,000 on PyPI
Adafruit-PureIOProvides pure Python access to Linux I2C and…
permissive · top 15,000 on PyPI
gpiozerogpiozero provides a high-level Python interface…
permissive · top 15,000 on PyPI
devicetreeProvides Python libraries for parsing and…
permissive · top 15,000 on PyPI