Skip to content

Commit

Permalink
Rename package to Inky
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Mar 13, 2019
1 parent 4bd2b82 commit af57968
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -2,8 +2,8 @@

[![Build Status](https://travis-ci.com/pimoroni/inky.svg?branch=master)](https://travis-ci.com/pimoroni/inky)
[![Coverage Status](https://coveralls.io/repos/github/pimoroni/inky/badge.svg?branch=master)](https://coveralls.io/github/pimoroni/inky?branch=master)
[![PyPi Package](https://img.shields.io/pypi/v/einky.svg)](https://pypi.python.org/pypi/einky)
[![Python Versions](https://img.shields.io/pypi/pyversions/einky.svg)](https://pypi.python.org/pypi/einky)
[![PyPi Package](https://img.shields.io/pypi/v/inky.svg)](https://pypi.python.org/pypi/inky)
[![Python Versions](https://img.shields.io/pypi/pyversions/inky.svg)](https://pypi.python.org/pypi/inky)

Python library for the [Inky pHAT](https://shop.pimoroni.com/products/inky-phat) and [Inky wHAT](https://shop.pimoroni.com/products/inky-what) e-paper displays.

Expand All @@ -18,10 +18,10 @@ Python library for the [Inky pHAT](https://shop.pimoroni.com/products/inky-phat)

# Installation

The Python pip package is named einky, install with:
The Python pip package is named inky, install with:

```
sudo pip install einky
sudo pip install inky
```

# Usage
Expand Down
22 changes: 22 additions & 0 deletions install.sh
@@ -0,0 +1,22 @@
#!/bin/bash

printf "Inky Python Library: Installer\n\n"

if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root. Try 'sudo ./install.sh'\n"
exit 1
fi

cd library

printf "Installing for Python 2..\n"
python setup.py install

if [ -f "/usr/bin/python3" ]; then
printf "Installing for Python 3..\n"
python3 setup.py install
fi

cd ..

printf "Done!\n"
70 changes: 60 additions & 10 deletions library/README.rst
Expand Up @@ -20,18 +20,19 @@ Inky wHAT
---------

`Inky wHAT <https://shop.pimoroni.com/products/inky-what>`__ is a
400x300 pixel e-paper display available in red/black/white. It's got
tons of resolution for detailed daily todo lists, multi-day weather
forecasts, bus timetables and more.
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 todo lists, multi-day weather forecasts, bus timetables
and more.

Installation
============

The Python pip package is named einky, install with:
The Python pip package is named inky, install with:

::

sudo pip install einky
sudo pip install inky

Usage
=====
Expand All @@ -58,13 +59,62 @@ Inky library like so:
from inky import InkyWHAT
inkywhat = InkyWHAT('red')
Since Inky wHAT is currently only available in red, we pick that colour.
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.

.. code:: python
inkyphat.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.

.. code:: python
inkyphat.set_border(colour)
``colour`` should be one of ``inky.RED``, ``inky.YELLOW``,
``inky.WHITE`` or ``inky.BLACK`` with available colours depending on
your diplay 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:

.. code:: python
inkyphat.show()
Migrating
=========

If you're migrating code from the ``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()``.

.. |Build Status| image:: https://travis-ci.com/pimoroni/inky.svg?branch=master
:target: https://travis-ci.com/pimoroni/inky
.. |Coverage Status| image:: https://coveralls.io/repos/github/pimoroni/inky/badge.svg?branch=master
:target: https://coveralls.io/github/pimoroni/inky?branch=master
.. |PyPi Package| image:: https://img.shields.io/pypi/v/einky.svg
:target: https://pypi.python.org/pypi/einky
.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/einky.svg
:target: https://pypi.python.org/pypi/einky
.. |PyPi Package| image:: https://img.shields.io/pypi/v/inky.svg
:target: https://pypi.python.org/pypi/inky
.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/inky.svg
:target: https://pypi.python.org/pypi/inky
2 changes: 1 addition & 1 deletion library/setup.py
Expand Up @@ -40,7 +40,7 @@
]

setup(
name='einky',
name='inky',
version='0.0.4',
author='Philip Howard',
author_email='phil@pimoroni.com',
Expand Down
24 changes: 24 additions & 0 deletions uninstall.sh
@@ -0,0 +1,24 @@
#!/bin/bash

PACKAGE="inky"

printf "Inky Python Library: Uninstaller\n\n"

if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root. Try 'sudo ./uninstall.sh'\n"
exit 1
fi

cd library

printf "Unnstalling for Python 2..\n"
pip uninstall $PACKAGE

if [ -f "/usr/bin/pip3" ]; then
printf "Uninstalling for Python 3..\n"
pip3 uninstall $PACKAGE
fi

cd ..

printf "Done!\n"

0 comments on commit af57968

Please sign in to comment.