Name | inky JSON |
Version |
2.0.0
JSON |
| download |
home_page | None |
Summary | Inky pHAT Driver |
upload_time | 2024-09-11 11:03:57 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT License Copyright (c) 2018 Pimoroni Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
raspberry pi
e-paper
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
# Inky
[](https://github.com/pimoroni/inky/actions/workflows/test.yml)
[](https://coveralls.io/github/pimoroni/inky?branch=main)
[](https://pypi.python.org/pypi/inky)
[](https://pypi.python.org/pypi/inky)
Python library for [Inky pHAT](https://shop.pimoroni.com/products/inky-phat), [Inky wHAT](https://shop.pimoroni.com/products/inky-what) and [Inky Impression](https://shop.pimoroni.com/?q=inky+impression) e-paper displays for Raspberry Pi.
## Inky pHAT
[Inky pHAT](https://shop.pimoroni.com/products/inky-phat) is a 250x122 pixel e-paper display, available in red/black/white, yellow/black/white and black/white. It's great for nametags and displaying very low frequency information such as a daily calendar or weather overview.
## Inky wHAT
[Inky wHAT](https://shop.pimoroni.com/products/inky-what) is a 400x300 pixel e-paper display available in red/black/white, yellow/black/white and black/white. It's got tons of resolution for detailed daily to-do lists, multi-day weather forecasts, bus timetables and more.
## Inky Impression
[Inky Impression](https://shop.pimoroni.com/?q=inky+impression) is our line of glorious 7 colour eInk displays, available in [4"](https://shop.pimoroni.com/products/inky-impression-4) (640 x 400 pixel) [5.7"](https://shop.pimoroni.com/products/inky-impression-5-7) (600 x 448 pixel) and [7.3"](https://shop.pimoroni.com/products/inky-impression-7-3) (800 x 480 pixel) flavours. They're packed with strong colours and perfect for displaying striking graphics or lots of data.
# Installation
# Installing
We'd recommend using this library with Raspberry Pi OS Bookworm or later. It requires Python ≥3.7.
## Full install (recommended):
We've created an easy installation script that will install all pre-requisites and get you up and running with minimal efforts. To run it, fire up Terminal which you'll find in Menu -> Accessories -> Terminal
on your Raspberry Pi desktop, as illustrated below:

In the new terminal window type the commands exactly as it appears below (check for typos) and follow the on-screen instructions:
```bash
git clone https://github.com/pimoroni/inky
cd inky
./install.sh
```
**Note** Libraries will be installed in the "pimoroni" virtual environment, you will need to activate it to run examples:
```
source ~/.virtualenvs/pimoroni/bin/activate
```
## Development:
If you want to contribute, or like living on the edge of your seat by having the latest code, you can install the development version like so:
```bash
git clone https://github.com/pimoroni/inky
cd inky
./install.sh --unstable
```
## Install stable library from PyPi and configure manually
* Set up a virtual environment: `python3 -m venv --system-site-packages $HOME/.virtualenvs/pimoroni`
* Switch to the virtual environment: `source ~/.virtualenvs/pimoroni/bin/activate`
* Install the library: `pip install inky`
In some cases you may need to us `sudo` or install pip with: `sudo apt install python3-pip`.
This will not make any configuration changes, so you may also need to enable:
* i2c: `sudo raspi-config nonint do_i2c 0`
* spi: `sudo raspi-config nonint do_spi 0`
You can optionally run `sudo raspi-config` or the graphical Raspberry Pi Configuration UI to enable interfaces.
# Usage
The library should be run with Python 3.
## Auto Setup
Inky can try to automatically identify your board (from the information stored on its EEPROM) and set up accordingly. This is the easiest way to work with recent Inky displays.
```python
from inky.auto import auto
display = auto()
```
You can then get the colour and resolution from the board:
```python
display.colour
display.resolution
```
## Manual Setup
If you have an older Inky without an EEPROM, you can specify the type manually. The Inky library contains modules for both the pHAT and wHAT, load the Inky pHAT one as follows:
```python
from inky import InkyPHAT
```
You'll then need to pick your colour, one of 'red', 'yellow' or 'black' and instantiate the class:
```python
display = InkyPHAT('red')
```
If you're using the wHAT you'll need to load the InkyWHAT class from the Inky library like so:
```python
from inky import InkyWHAT
display = InkyWHAT('red')
```
Once you've initialised Inky, there are only three methods you need to be concerned with:
## Set Image
Set a PIL image, numpy array or list to Inky's internal buffer. The image dimensions should match the dimensions of the pHAT or wHAT you're using.
```python
display.set_image(image)
```
You should use `PIL` to create an image. `PIL` provides an `ImageDraw` module which allow you to draw text, lines and shapes over your image. See: https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html
## Set Border
Set the border colour of you pHAT or wHAT.
```python
display.set_border(colour)
```
`colour` should be one of `inky.RED`, `inky.YELLOW`, `inky.WHITE` or `inky.BLACK` with available colours depending on your display type.
## Update The Display
Once you've prepared and set your image, and chosen a border colour, you can update your e-ink display with:
```python
display.show()
```
# Migrating
If you're migrating code from the old `inkyphat` library you'll find that much of the drawing and image manipulation functions have been removed from Inky. These functions were always supplied by PIL, and the recommended approach is to use PIL to create and prepare your image before setting it to Inky with `set_image()`.
2.0.0
-----
* Rewrite to gpiod/gpiodevice.
* Repackage to hatch/pyproject.toml.
* Breaking: Fixes to chip-select behaviour across all boards
1.5.0
-----
* New: inky impression 7.3" support.
* BugFix: WIDTH / HEIGHT set on uc8159.
1.4.0
-----
* New: inky SSD1683 support for WHAT variant
1.3.2
-----
* BugFix: (ish) handle busy_wait failure cases for UC8159 (Inky Impression)
1.3.1
-----
* BugFix: unbreak UC8159
1.3.0
-----
* New: inky UC8159 support for 4" 640x400 display variant
* BugFix: fix set_image so it doesn't break set_pixel
* New: Added --simulate <board> to "auto()", so auto examples can simulate a chosen board
1.2.2
-----
* BugFix: Raise Impression/7Color/UC8159 busy wait timeout from 15s to 30s
1.2.1
-----
* BugFix: inky high-temp red fix
* Enhancement: SSD1608 (250x122) set_border support
1.2.0
-----
* New: inky impression set_border support
* BugFix: inky impression orange colour
* BugFix: inky impression invalid arg bug for Python 2
* New: inky impression simulator
1.1.1
-----
* Enhancement: drive UC81559 CS with GPIO to avoid conflict with Grow workaround
* Add 7-colour/UC8159 specifics to EEPROM
* BugFix: define UC8159 colour and size constants in class
* BugFix: fix auto to grab args properly, support UC8159 and fallback gracefully
1.1.0
-----
* New: Support for UC8159-based 7-colour 600x448 display
* Enhancement: auto now includes options for fallback
* Enhancement: EEPROM can now give text string for display variant
1.0.2
-----
* Enhancement: Always install Pi dependencies
1.0.1
-----
* Enhancement: Tweak setup.py extras for easier dependency install
1.0.0
-----
* New: Support for SSD1608-based displays
* New: Mock Inky pHAT and wHAT displays
* New: Automatic Inky detection and class constructor
* Enhancement: Support for alternate i2c_bus when reading eeprom
* Enhancement: Support for alternate spi_bus
* Enhancement: Support for alternate GPIO driver
* Enhancement: Replaced sys.exit calls with ImportError
* Enhancement: Improved docstrings
0.0.5
-----
* Enhancement: Added support for red/b/w high-temp Inky wHAT
0.0.4
-----
* BugFix: Reverted normal red LUTs to correct values
0.0.3
-----
* Enhancement: Added support for display variant detection
* Enhancement: Added DocStrings
* BugFix: Fixed set_border for all colours
0.0.2
-----
* BugFix: Yellow Inky pHAT now yellow instead of brown/black
* Enhancement: Performance tweak for set_image
0.0.1
-----
* Initial Release
Raw data
{
"_id": null,
"home_page": null,
"name": "inky",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "Philip Howard <phil@pimoroni.com>",
"keywords": "Raspberry Pi, e-paper",
"author": null,
"author_email": "Philip Howard <phil@pimoroni.com>",
"download_url": "https://files.pythonhosted.org/packages/a5/bd/cd7865a18f30e731b4b5f3fdaecad29f88d3ba0fc84ecf09b77b0e5d2459/inky-2.0.0.tar.gz",
"platform": null,
"description": "# Inky\n\n[](https://github.com/pimoroni/inky/actions/workflows/test.yml)\n[](https://coveralls.io/github/pimoroni/inky?branch=main)\n[](https://pypi.python.org/pypi/inky)\n[](https://pypi.python.org/pypi/inky)\n\nPython library for [Inky pHAT](https://shop.pimoroni.com/products/inky-phat), [Inky wHAT](https://shop.pimoroni.com/products/inky-what) and [Inky Impression](https://shop.pimoroni.com/?q=inky+impression) e-paper displays for Raspberry Pi.\n\n## Inky pHAT\n\n[Inky pHAT](https://shop.pimoroni.com/products/inky-phat) is a 250x122 pixel e-paper display, available in red/black/white, yellow/black/white and black/white. It's great for nametags and displaying very low frequency information such as a daily calendar or weather overview.\n\n\n## Inky wHAT\n\n[Inky wHAT](https://shop.pimoroni.com/products/inky-what) is a 400x300 pixel e-paper display available in red/black/white, yellow/black/white and black/white. It's got tons of resolution for detailed daily to-do lists, multi-day weather forecasts, bus timetables and more.\n\n## Inky Impression\n\n[Inky Impression](https://shop.pimoroni.com/?q=inky+impression) is our line of glorious 7 colour eInk displays, available in [4\"](https://shop.pimoroni.com/products/inky-impression-4) (640 x 400 pixel) [5.7\"](https://shop.pimoroni.com/products/inky-impression-5-7) (600 x 448 pixel) and [7.3\"](https://shop.pimoroni.com/products/inky-impression-7-3) (800 x 480 pixel) flavours. They're packed with strong colours and perfect for displaying striking graphics or lots of data.\n\n# Installation\n\n# Installing\n\nWe'd recommend using this library with Raspberry Pi OS Bookworm or later. It requires Python \u22653.7.\n\n## Full install (recommended):\n\nWe've created an easy installation script that will install all pre-requisites and get you up and running with minimal efforts. To run it, fire up Terminal which you'll find in Menu -> Accessories -> Terminal\non your Raspberry Pi desktop, as illustrated below:\n\n\n\nIn the new terminal window type the commands exactly as it appears below (check for typos) and follow the on-screen instructions:\n\n```bash\ngit clone https://github.com/pimoroni/inky\ncd inky\n./install.sh\n```\n\n**Note** Libraries will be installed in the \"pimoroni\" virtual environment, you will need to activate it to run examples:\n\n```\nsource ~/.virtualenvs/pimoroni/bin/activate\n```\n\n## Development:\n\nIf you want to contribute, or like living on the edge of your seat by having the latest code, you can install the development version like so:\n\n```bash\ngit clone https://github.com/pimoroni/inky\ncd inky\n./install.sh --unstable\n```\n\n## Install stable library from PyPi and configure manually\n\n* Set up a virtual environment: `python3 -m venv --system-site-packages $HOME/.virtualenvs/pimoroni`\n* Switch to the virtual environment: `source ~/.virtualenvs/pimoroni/bin/activate`\n* Install the library: `pip install inky`\n\nIn some cases you may need to us `sudo` or install pip with: `sudo apt install python3-pip`.\n\nThis will not make any configuration changes, so you may also need to enable:\n\n* i2c: `sudo raspi-config nonint do_i2c 0`\n* spi: `sudo raspi-config nonint do_spi 0`\n\nYou can optionally run `sudo raspi-config` or the graphical Raspberry Pi Configuration UI to enable interfaces.\n\n# Usage\n\nThe library should be run with Python 3.\n\n## Auto Setup\n\nInky can try to automatically identify your board (from the information stored on its EEPROM) and set up accordingly. This is the easiest way to work with recent Inky displays.\n\n```python\nfrom inky.auto import auto\ndisplay = auto()\n```\n\nYou can then get the colour and resolution from the board:\n\n```python\ndisplay.colour\ndisplay.resolution\n```\n\n## Manual Setup\n\nIf you have an older Inky without an EEPROM, you can specify the type manually. The Inky library contains modules for both the pHAT and wHAT, load the Inky pHAT one as follows:\n\n```python\nfrom inky import InkyPHAT\n```\n\nYou'll then need to pick your colour, one of 'red', 'yellow' or 'black' and instantiate the class:\n\n```python\ndisplay = InkyPHAT('red')\n```\n\nIf you're using the wHAT you'll need to load the InkyWHAT class from the Inky library like so:\n\n```python\nfrom inky import InkyWHAT\ndisplay = InkyWHAT('red')\n```\n\nOnce you've initialised Inky, there are only three methods you need to be concerned with:\n\n## Set Image\n\nSet a PIL image, numpy array or list to Inky's internal buffer. The image dimensions should match the dimensions of the pHAT or wHAT you're using.\n\n```python\ndisplay.set_image(image)\n```\n\nYou should use `PIL` to create an image. `PIL` provides an `ImageDraw` module which allow you to draw text, lines and shapes over your image. See: https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html\n\n## Set Border\n\nSet the border colour of you pHAT or wHAT.\n\n```python\ndisplay.set_border(colour)\n```\n\n`colour` should be one of `inky.RED`, `inky.YELLOW`, `inky.WHITE` or `inky.BLACK` with available colours depending on your display type.\n\n## Update The Display\n\nOnce you've prepared and set your image, and chosen a border colour, you can update your e-ink display with:\n\n```python\ndisplay.show()\n```\n\n\n# Migrating\n\nIf you're migrating code from the old `inkyphat` library you'll find that much of the drawing and image manipulation functions have been removed from Inky. These functions were always supplied by PIL, and the recommended approach is to use PIL to create and prepare your image before setting it to Inky with `set_image()`.\n\n2.0.0\n-----\n\n* Rewrite to gpiod/gpiodevice.\n* Repackage to hatch/pyproject.toml.\n* Breaking: Fixes to chip-select behaviour across all boards\n\n1.5.0\n-----\n\n* New: inky impression 7.3\" support.\n* BugFix: WIDTH / HEIGHT set on uc8159.\n\n1.4.0\n-----\n\n* New: inky SSD1683 support for WHAT variant\n\n1.3.2\n-----\n\n* BugFix: (ish) handle busy_wait failure cases for UC8159 (Inky Impression)\n\n1.3.1\n-----\n\n* BugFix: unbreak UC8159\n\n1.3.0\n-----\n\n* New: inky UC8159 support for 4\" 640x400 display variant\n* BugFix: fix set_image so it doesn't break set_pixel\n* New: Added --simulate <board> to \"auto()\", so auto examples can simulate a chosen board\n\n1.2.2\n-----\n\n* BugFix: Raise Impression/7Color/UC8159 busy wait timeout from 15s to 30s\n\n1.2.1\n-----\n\n* BugFix: inky high-temp red fix\n* Enhancement: SSD1608 (250x122) set_border support\n\n1.2.0\n-----\n\n* New: inky impression set_border support\n* BugFix: inky impression orange colour\n* BugFix: inky impression invalid arg bug for Python 2\n* New: inky impression simulator\n\n1.1.1\n-----\n\n* Enhancement: drive UC81559 CS with GPIO to avoid conflict with Grow workaround\n* Add 7-colour/UC8159 specifics to EEPROM\n* BugFix: define UC8159 colour and size constants in class\n* BugFix: fix auto to grab args properly, support UC8159 and fallback gracefully\n\n1.1.0\n-----\n\n* New: Support for UC8159-based 7-colour 600x448 display\n* Enhancement: auto now includes options for fallback\n* Enhancement: EEPROM can now give text string for display variant\n\n1.0.2\n-----\n\n* Enhancement: Always install Pi dependencies\n\n1.0.1\n-----\n\n* Enhancement: Tweak setup.py extras for easier dependency install\n\n1.0.0\n-----\n\n* New: Support for SSD1608-based displays\n* New: Mock Inky pHAT and wHAT displays\n* New: Automatic Inky detection and class constructor\n* Enhancement: Support for alternate i2c_bus when reading eeprom\n* Enhancement: Support for alternate spi_bus\n* Enhancement: Support for alternate GPIO driver\n* Enhancement: Replaced sys.exit calls with ImportError\n* Enhancement: Improved docstrings\n\n0.0.5\n-----\n\n* Enhancement: Added support for red/b/w high-temp Inky wHAT\n\n0.0.4\n-----\n\n* BugFix: Reverted normal red LUTs to correct values\n\n0.0.3\n-----\n\n* Enhancement: Added support for display variant detection\n* Enhancement: Added DocStrings\n* BugFix: Fixed set_border for all colours\n\n0.0.2\n-----\n\n* BugFix: Yellow Inky pHAT now yellow instead of brown/black\n* Enhancement: Performance tweak for set_image\n\n0.0.1\n-----\n\n* Initial Release\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2018 Pimoroni Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Inky pHAT Driver",
"version": "2.0.0",
"project_urls": {
"GitHub": "https://www.github.com/pimoroni/inky",
"Homepage": "https://www.pimoroni.com"
},
"split_keywords": [
"raspberry pi",
" e-paper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b04c5ead781b6f99d4868ad5fb0900b2849da8e227eaec44cd9393c6e052ea6d",
"md5": "5bc0761708284a3755ba3daf88c7b05c",
"sha256": "bacbde3b34701b3e355f6ba26cb89ae3f542c4fec3a4aec6da47312baf0a9caf"
},
"downloads": -1,
"filename": "inky-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5bc0761708284a3755ba3daf88c7b05c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 40623,
"upload_time": "2024-09-11T11:03:52",
"upload_time_iso_8601": "2024-09-11T11:03:52.549591Z",
"url": "https://files.pythonhosted.org/packages/b0/4c/5ead781b6f99d4868ad5fb0900b2849da8e227eaec44cd9393c6e052ea6d/inky-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a5bdcd7865a18f30e731b4b5f3fdaecad29f88d3ba0fc84ecf09b77b0e5d2459",
"md5": "15640e6a52120dd17dcdb0c8ace905c6",
"sha256": "62e826fcb73c9578209c788dcf5857644f3de2c70743ffb91f7fe869123e2895"
},
"downloads": -1,
"filename": "inky-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "15640e6a52120dd17dcdb0c8ace905c6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 12362459,
"upload_time": "2024-09-11T11:03:57",
"upload_time_iso_8601": "2024-09-11T11:03:57.122683Z",
"url": "https://files.pythonhosted.org/packages/a5/bd/cd7865a18f30e731b4b5f3fdaecad29f88d3ba0fc84ecf09b77b0e5d2459/inky-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-11 11:03:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pimoroni",
"github_project": "inky",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "inky"
}