Registry / devops / adafruit-platformdetect

adafruit-platformdetect

JSON →
library3.88.0pypypi✓ verified 84d ago

Adafruit PlatformDetect is a Python library designed for best-guess platform detection across a wide range of single-board computers (SBCs) and other platforms. It primarily serves as a core dependency for Adafruit-Blinka, enabling CircuitPython API emulation on CPython. The library maintains an active development cycle with frequent releases to add support for new boards and chips.

pip install adafruit-platformdetect
INSTALL
IMPORT
SIG · ADAFRUIT-PLATFORMD
A
adafruit-platformdetect
devopspythonv3.88.0
Install
1.5s avg
Import
16ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.88.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.017s · 18MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.016s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Detector
from adafruit_platformdetect import Detector

This quickstart code demonstrates how to initialize the `Detector` and retrieve the detected chip and board IDs. It also includes examples of checking for specific popular board models.

import os from adafruit_platformdetect import Detector detector = Detector() print(f"Chip ID: {detector.chip.id}") print(f"Board ID: {detector.board.id}") if detector.board.RASPBERRY_PI_3B_PLUS: print("This is a Raspberry Pi 3B+") elif detector.board.BEAGLEBONE_BLACK: print("This is a BeagleBone Black") elif detector.board.ORANGE_PI_PC: print("This is an Orange Pi PC") elif detector.board.GENERIC_LINUX_PC: print("This is a generic Linux PC") else: print("Platform not specifically identified by common board checks.") # Example of checking if a specific chip is present if detector.chip.ANY_BROADCOM_CHIP: print("Running on a Broadcom chip (like Raspberry Pi)") # Example of forcing detection (for testing or specific setups) # Uncomment and set an environment variable before running if needed # os.environ['BLINKA_FORCEBOARD'] = 'GENERIC_LINUX_PC' # os.environ['BLINKA_FORCECHIP'] = 'GENERIC_LINUX_CHIP'
Debug
Known issues
gotchaPlatform detection can be overridden by environment variables like `BLINKA_FORCEBOARD` and `BLINKA_FORCECHIP`. This is primarily for testing or specific hardware setups (e.g., FT232H, SPIDriver). If these are set, they will bypass standard hardware detection.
fix
Be aware of these environment variables if detection results are unexpected. Unset them if not intentionally used, or consult `adafruit_platformdetect/chip.py` and `adafruit_platformdetect/board.py` for their effects.
affects: All versions
gotchaRunning on new, unsupported hardware with an older version of adafruit-platformdetect can lead to `NotImplementedError` or 'Board not supported' messages.
fix
Always ensure you have the latest version installed: `pip install --upgrade adafruit-platformdetect adafruit-blinka`.
affects: All versions prior to current board support
gotchaIncorrect installation methods (e.g., using `sudo pip install` then running as a normal user, or installing in a virtual environment and not activating it) can lead to `ModuleNotFoundError`.
fix
Always install either for the current user (`pip install adafruit-platformdetect`) or within an activated virtual environment. Avoid `sudo pip install` unless absolutely necessary for system-wide installations and understand the implications.
affects: All versions
Errors
Common errors & fixes
NotImplementedError: Adafruit-PlatformDetect version X.Y.Z was unable to identify the board and/or microcontroller running the [PLATFORM] platform.
The Adafruit-PlatformDetect library is an older version that does not include detection logic for your specific board or microcontroller, or the platform is genuinely unsupported.
fix
Upgrade to the latest version of adafruit-platformdetect and adafruit-blinka: `pip install --upgrade adafruit-platformdetect adafruit-blinka`. If the problem persists, open a 'New Board Request' issue on the Adafruit Blinka GitHub repository.
ModuleNotFoundError: No module named 'adafruit_platformdetect'
The `adafruit-platformdetect` package is not installed in the Python environment where the script is being executed, or it was installed incorrectly (e.g., using `sudo pip` and running as a different user).
fix
Ensure the library is installed in your active Python environment: `pip install adafruit-platformdetect`. If using a virtual environment, make sure it is activated before installation and execution. If installed system-wide with `sudo`, ensure you run your script with `sudo` as well (though generally discouraged).
RuntimeError: BLINKA_FT232H environment variable set, but no FT232H device found
The `BLINKA_FT232H` environment variable is set, forcing Adafruit-PlatformDetect to look for an FT232H device, but no such device is connected or detected by `pyftdi`.
fix
If you are not using an FT232H, unset the `BLINKA_FT232H` environment variable. If you intend to use an FT232H, ensure it is properly connected and that `pyftdi` is installed (`pip install pyftdi`).
Upgrade
Version history
3.88.0latest on PyPI · released Feb 24, 2026
Audit
Dependencies
PythonrequiredRequires Python 3.7 or higher.
Agent activity
56 hits · last 30 days
node
44
OpenAI (training)
2
Resources
adafruit-platformdetect — pip install adafruit-platformdetect · libregistry