adafruit-circuitpython-typing provides Python type hints, specifically Protocol definitions and TypeAliases, for common hardware interface types found in CircuitPython, such as BlockDevice, SPIDevice, and AnyDisplay. It facilitates static type checking for CircuitPython applications developed in CPython environments. The library is currently at version 1.12.3 and is actively maintained with frequent minor releases.
pip install adafruit-circuitpython-typingVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and use the `BlockDevice` and `AnyDisplay` types in function signatures. These types are primarily used for static type checking to ensure compatibility with various hardware interfaces, not for runtime instantiation. The example includes mock implementations to illustrate how objects conforming to the protocols would be used.
Use the types only in type annotations (e.g., `device: BlockDevice`). Instances are provided by actual hardware drivers, not by this library directly.
Ensure your CPython development environment uses Python 3.8 or a later version. Upgrade your Python installation if necessary.
Use this library only in your CPython development environment (e.g., on your desktop computer) for linting and static analysis. For microcontrollers, simply use the actual CircuitPython libraries without explicit type hinting dependencies from this package.
No dependency data recorded yet.