skillfed

Adafruit-PlatformDetect

Platform detection for use by libraries like Adafruit-Blinka.

adafruit-platformdetect v3.89.1 158.7K downloads/30d#10,713 on PyPI64
Permissive license MIT Active released

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-platformdetect

uv

uv add adafruit-platformdetect

poetry

poetry add adafruit-platformdetect

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.7Topic :: Software Development :: LibrariesTopic :: System :: Hardware

Tags

single-board computer detectionraspberry pi board detectionplatform chip identificationhardware platform detectionbeaglebone board detectionarm board detectiondevice platform discovery
hardware-detectionsingle-board-computerembedded-systems

More Libraries packages