Skip to content

Commit b4cab15

Browse files
authored
Merge pull request #18 from kattni/pypi-setup
PyPI setup and README update.
2 parents ba82d84 + ebefc30 commit b4cab15

File tree

2 files changed

+93
-8
lines changed

2 files changed

+93
-8
lines changed

README.rst

+40-8
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,52 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
2525
This is easily achieved by downloading
2626
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
2727

28+
29+
Installing from PyPI
30+
=====================
31+
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
32+
PyPI <https://pypi.org/project/adafruit-circuitpython-led animation/>`_. To install for current user:
33+
34+
.. code-block:: shell
35+
36+
pip3 install adafruit-circuitpython-led animation
37+
38+
To install system-wide (this may be required in some cases):
39+
40+
.. code-block:: shell
41+
42+
sudo pip3 install adafruit-circuitpython-led animation
43+
44+
To install in a virtual environment in your current project:
45+
46+
.. code-block:: shell
47+
48+
mkdir project-name && cd project-name
49+
python3 -m venv .env
50+
source .env/bin/activate
51+
pip3 install adafruit-circuitpython-led animation
52+
2853
Usage Example
2954
=============
3055

3156
.. code-block:: python
3257
33-
import adafruit_dotstar as dotstar
3458
import board
35-
from led_animation import color
36-
# setup the pixel
37-
dot = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1, brightness=.2)
38-
# set the color by name
39-
dot[0] = color.GOLD
40-
# show the pixel
41-
dot.show()
59+
import neopixel
60+
from adafruit_led_animation.animation import Blink
61+
import adafruit_led_animation.color as color
62+
63+
# Works on Circuit Playground Express and Bluefruit.
64+
# For other boards, change board.NEOPIXEL to match the pin to which the NeoPixels are attached.
65+
pixel_pin = board.NEOPIXEL
66+
# Change to match the number of pixels you have attached to your board.
67+
num_pixels = 10
68+
69+
pixels = neopixel.NeoPixel(pixel_pin, num_pixels)
70+
blink = Blink(pixels, 0.5, color.PURPLE)
71+
72+
while True:
73+
blink.animate()
4274
4375
Contributing
4476
============

setup.py

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
"""A setuptools based setup module.
2+
3+
See:
4+
https://packaging.python.org/en/latest/distributing.html
5+
https://github.com/pypa/sampleproject
6+
"""
7+
8+
from setuptools import setup, find_packages
9+
10+
# To use a consistent encoding
11+
from codecs import open
12+
from os import path
13+
14+
here = path.abspath(path.dirname(__file__))
15+
16+
# Get the long description from the README file
17+
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
18+
long_description = f.read()
19+
20+
setup(
21+
name="adafruit-circuitpython-led animation",
22+
use_scm_version=True,
23+
setup_requires=["setuptools_scm"],
24+
description="CircuitPython helper for LED colors and animations.",
25+
long_description=long_description,
26+
long_description_content_type="text/x-rst",
27+
# The project's main homepage.
28+
url="https://github.com/adafruit/Adafruit_CircuitPython_LED Animation",
29+
# Author details
30+
author="Adafruit Industries",
31+
author_email="[email protected]",
32+
install_requires=["Adafruit-Blinka",],
33+
# Choose your license
34+
license="MIT",
35+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
36+
classifiers=[
37+
"Development Status :: 3 - Alpha",
38+
"Intended Audience :: Developers",
39+
"Topic :: Software Development :: Libraries",
40+
"Topic :: System :: Hardware",
41+
"License :: OSI Approved :: MIT License",
42+
"Programming Language :: Python :: 3",
43+
"Programming Language :: Python :: 3.4",
44+
"Programming Language :: Python :: 3.5",
45+
],
46+
# What does your project relate to?
47+
keywords="adafruit blinka circuitpython micropython led animation led colors animations",
48+
# You can just specify the packages manually here if your project is
49+
# simple. Or you can use find_packages().
50+
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,
51+
# CHANGE `py_modules=['...']` TO `packages=['...']`
52+
py_modules=["adafruit_led animation"],
53+
)

0 commit comments

Comments
 (0)