Skip to content

Commit bc9176b

Browse files
Autogenerated. Convert PyPi packaging and add Readme Updates
1 parent d76efef commit bc9176b

File tree

6 files changed

+185
-174
lines changed

6 files changed

+185
-174
lines changed

README.md

Lines changed: 90 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,131 @@
1-
Qwiic_Alphanumeric_Py
2-
===============
1+
![Qwiic ALPHANUMERIC - Python Package](docs/images/gh-banner.png "qwiic ALPHANUMERIC Python Package")
32

4-
<p align="center">
5-
<img src="https://cdn.sparkfun.com/assets/custom_pages/2/7/2/qwiic-logo-registered.jpg" width=200>
6-
<img src="https://www.python.org/static/community_logos/python-logo-master-v3-TM.png" width=240>
7-
</p>
8-
<p align="center">
9-
<a href="https://pypi.org/project/sparkfun-qwiic-alphanumeric/" alt="Package">
10-
<img src="https://img.shields.io/pypi/pyversions/sparkfun-qwiic-alphanumeric.svg" /></a>
11-
<a href="https://github.com/sparkfun/Qwiic_Alphanumeric_Py/issues" alt="Issues">
12-
<img src="https://img.shields.io/github/issues/sparkfun/Qwiic_Alphanumeric_Py.svg" /></a>
13-
<a href="https://qwiic-alphanumeric-py.readthedocs.io/en/latest/?" alt="Documentation">
14-
<img src="https://readthedocs.org/projects/qwiic-alphanumeric-py/badge/?version=latest&style=flat" /></a>
15-
<a href="https://github.com/sparkfun/Qwiic_Alphanumeric_Py/blob/master/LICENSE" alt="License">
16-
<img src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
17-
<a href="https://twitter.com/intent/follow?screen_name=sparkfun">
18-
<img src="https://img.shields.io/twitter/follow/sparkfun.svg?style=social&logo=twitter"
19-
alt="follow on Twitter"></a>
3+
# SparkFun Qwiic ALPHANUMERIC - Python Package
204

21-
</p>
5+
![PyPi Version](https://img.shields.io/pypi/v/sparkfun_qwiic_alphanumeric)
6+
![GitHub issues](https://img.shields.io/github/issues/sparkfun/qwiic_alphanumeric_py)
7+
![License](https://img.shields.io/github/license/sparkfun/qwiic_alphanumeric_py)
8+
![X](https://img.shields.io/twitter/follow/sparkfun)
9+
[![API](https://img.shields.io/badge/API%20Reference-blue)](https://docs.sparkfun.com/qwiic_alphanumeric_py/classqwiic__alphanumeric_1_1_qwiic_alphanumeric.html)
2210

11+
The SparkFun Qwiic Alphanumeric Display ALPHANUMERIC Module provides a simple and cost effective solution for adding Alphanumeric Display capabilities to your project. Implementing a SparkFun Qwiic I2C interface, these sensors can be rapidly added to any project with boards that are part of the SparkFun Qwiic ecosystem.
2312

24-
<img src="https://cdn.sparkfun.com/assets/parts/1/5/8/5/5/16919-SparkFun_Qwiic_Alphanumeric_Display_-_Pink-01.jpg" align="right" width=300 alt="SparkFun Qwiic Alphanumeric - Pink">
13+
This repository implements a Python package for the SparkFun Qwiic ALPHANUMERIC. This package works with Python, MicroPython and CircuitPython.
2514

26-
Python module for the [SparkFun Qwiic Alphanumeric Display].
15+
### Contents
2716

28-
It is compatible with the following products:
29-
* [SparkFun Qwiic Alphanumeric Display - Pink](https://www.sparkfun.com/products/16919)
30-
* [SparkFun Qwiic Alphanumeric Display - Red](https://www.sparkfun.com/products/16916)
31-
* [SparkFun Qwiic Alphanumeric Display - Purple](https://www.sparkfun.com/products/16918)
32-
* [SparkFun Qwiic Alphanumeric Display - Blue](https://www.sparkfun.com/products/16917)
33-
* [SparkFun Qwiic Alphanumeric Display - Green](https://www.sparkfun.com/products/18566)
34-
* [SparkFun Qwiic Alphanumeric Display - White](https://www.sparkfun.com/products/18656)
17+
* [About](#about-the-package)
18+
* [Getting Started](#getting-started)
19+
* [Installation](#installation)
20+
* [Supported Platforms](#supported-platforms)
21+
* [Documentation](https://docs.sparkfun.com/qwiic_alphanumeric_py/classqwiic__alphanumeric_1_1_qwiic_alphanumeric.html)
22+
* [Examples](#examples)
3523

36-
This python package is a port of the existing [SparkFun Qwiic Alphanumeric Arduino Library](https://github.com/sparkfun/SparkFun_Alphanumeric_Display_Arduino_Library)
24+
## About the Package
3725

38-
This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)
26+
This python package enables the user to access the features of the ALPHANUMERIC via a single Qwiic cable. This includes <writing to the display, setting the blink rate, scrolling characters> and more. The capabilities of the ALPHANUMERIC are each demonstrated in the included examples.
3927

4028
New to qwiic? Take a look at the entire [SparkFun qwiic ecosystem](https://www.sparkfun.com/qwiic).
4129

42-
## Contents
30+
### Supported SparkFun Products
4331

44-
* [Supported Platforms](#supported-platforms)
45-
* [Dependencies](#dependencies)
46-
* [Installation](#installation)
47-
* [Documentation](#documentation)
48-
* [Example Use](#example-use)
32+
This Python package supports the following SparkFun qwiic products on Python, MicroPython and Circuit python.
4933

50-
Supported Platforms
51-
--------------------
52-
The Qwiic LED Stick Python package currently supports the following platforms:
53-
* [Raspberry Pi](https://www.sparkfun.com/search/results?term=raspberry+pi)
34+
* [SparkFun Alphanumeric Display Sensor - ALPHANUMERIC](https://www.sparkfun.com/products/16916)
5435

55-
Dependencies
56-
--------------
57-
This driver package depends on the qwiic I2C driver:
58-
[Qwiic_I2C_Py](https://github.com/sparkfun/Qwiic_I2C_Py)
36+
### Supported Platforms
5937

60-
Documentation
61-
-------------
62-
The SparkFun Qwiic LED Stick module documentation is hosted at [ReadTheDocs](https://qwiic-alphanumeric-py.readthedocs.io/en/latest/index.html)
38+
| Python | Platform | Boards |
39+
|--|--|--|
40+
| Python | Linux | [Raspberry Pi](https://www.sparkfun.com/raspberry-pi-5-8gb.html) , [NVIDIA Jetson Orin Nano](https://www.sparkfun.com/nvidia-jetson-orin-nano-developer-kit.html) via the [SparkFun Qwiic SHIM](https://www.sparkfun.com/sparkfun-qwiic-shim-for-raspberry-pi.html) |
41+
| MicroPython | Raspberry Pi - RP2, ESP32 | [SparkFun RP2040 Thing+](https://www.sparkfun.com/sparkfun-thing-plus-rp2040.html), [SparkFun RP2350 Thing+](https://www.sparkfun.com/sparkfun-thing-plus-rp2350.html), [SparkFun ESP32 Thing+](https://www.sparkfun.com/sparkfun-thing-plus-esp32-wroom-usb-c.html)
42+
|CircuitPython | Raspberry Pi - RP2, ESP32 | [SparkFun RP2040 Thing+](https://www.sparkfun.com/sparkfun-thing-plus-rp2040.html), [SparkFun RP2350 Thing+](https://www.sparkfun.com/sparkfun-thing-plus-rp2350.html), [SparkFun ESP32 Thing+](https://www.sparkfun.com/sparkfun-thing-plus-esp32-wroom-usb-c.html)
6343

64-
Installation
65-
---------------
66-
### PyPi Installation
44+
> [!NOTE]
45+
> The listed supported platforms and boards are the primary platform targets tested. It is fully expected that this package will work across a wide variety of Python enabled systems.
6746
68-
This repository is hosted on PyPi as the [sparkfun-qwiic-alphanumeric](https://pypi.org/project/sparkfun-qwiic-alphanumeric/) package. On systems that support PyPi installation via pip, this library is installed using the following commands
47+
## Installation
6948

70-
For all users (note: the user must have sudo privileges):
49+
The first step to using this package is installing it on your system. The install method depends on the python platform. The following sections outline installation on Python, MicroPython and CircuitPython.
50+
51+
### Python
52+
53+
#### PyPi Installation
54+
55+
The package is primarily installed using the `pip3` command, downloading the package from the Python Index - "PyPi".
56+
57+
Note - the below instructions outline installation on a Linux-based (Raspberry Pi) system.
58+
59+
First, setup a virtual environment from a specific directory using venv:
7160
```sh
72-
sudo pip install sparkfun-qwiic-alphanumeric
61+
python3 -m venv path/to/venv
7362
```
74-
For the current user:
63+
You can pass any path as path/to/venv, just make sure you use the same one for all future steps. For more information on venv [click here](https://docs.python.org/3/library/venv.html).
7564

65+
Next, install the qwiic package with:
66+
```sh
67+
path/to/venv/bin/pip3 install sparkfun-qwiic-alphanumeric
68+
```
69+
Now you should be able to run any example or custom python scripts that have `import qwiic_alphanumeric` by running e.g.:
7670
```sh
77-
pip install sparkfun-qwiic-alphanumeric
71+
path/to/venv/bin/python3 example_script.py
7872
```
79-
To install, make sure the setuptools package is installed on the system.
8073

81-
Direct installation at the command line:
74+
### MicroPython Installation
75+
If not already installed, follow the [instructions here](https://docs.micropython.org/en/latest/reference/mpremote.html) to install mpremote on your computer.
76+
77+
Connect a device with MicroPython installed to your computer and then install the package directly to your device with mpremote mip.
78+
```sh
79+
mpremote mip install github:sparkfun/qwiic_alphanumeric_py
80+
```
81+
82+
If you would also like to install the examples for this repository, issue the following mip command as well:
83+
```sh
84+
mprmeote mip install github:sparkfun/qwiic_alphanumeric_py@examples
85+
```
86+
87+
### CircuitPython Installation
88+
If not already installed, follow the [instructions here](https://docs.circuitpython.org/projects/circup/en/latest/#installation) to install CircUp on your computer.
89+
90+
Ensure that you have the latest version of the SparkFun Qwiic CircuitPython bundle.
8291
```sh
83-
python setup.py install
92+
circup bundle-add sparkfun/Qwiic_Py
8493
```
8594

86-
To build a package for use with pip:
95+
Finally, connect a device with CircuitPython installed to your computer and then install the package directly to your device with circup.
8796
```sh
88-
python setup.py sdist
89-
```
90-
A package file is built and placed in a subdirectory called dist. This package file can be installed using pip.
97+
circup install --py qwiic_alphanumeric
98+
```
99+
100+
If you would like to install any of the examples from this repository, issue the corresponding circup command from below. (NOTE: The below syntax assumes you are using CircUp on Windows. Linux and Mac will have different path seperators (i.e. "/" vs. "\"). See the [CircUp "example" command documentation](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/example-command) for more information)
101+
91102
```sh
92-
cd dist
93-
pip install sparkfun-qwiic-alphanumeric-<version>.tar.gz
103+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex01_print_string
104+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex02_turn_on_one_segment
105+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex03_print_char
106+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex04_set_brightness
107+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex05_set_blink_rate
108+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex06_colon_and_decimal
109+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex07_unknown_char
110+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex08_multi_display
111+
circup example qwiic_alphanumeric\qwiic_alphanumeric_ex09_scrolling_string
94112
```
95113

96114
Example Use
97-
-------------
98-
See the examples directory for more detailed use examples.
115+
---------------
116+
Below is a quickstart program to print readings from the ALPHANUMERIC.
117+
118+
See the examples directory for more detailed use examples and [examples/README.md](https://github.com/sparkfun/qwiic_alphanumeric_py/blob/main/examples/README.md) for a summary of the available examples.
99119

100120
```python
101-
from __future__ import print_function
121+
102122
import qwiic_alphanumeric
103123
import time
104124
import sys
105125

106126
def run_example():
107127

108-
print("\nSparkFun Qwiic Alphanumeric - Example 4: Print String")
128+
print("\nSparkFun Qwiic Alphanumeric - Example 1: Print String")
109129
my_display = qwiic_alphanumeric.QwiicAlphanumeric()
110130

111131
if my_display.begin() == False:
@@ -121,8 +141,9 @@ if __name__ == '__main__':
121141
try:
122142
run_example()
123143
except (KeyboardInterrupt, SystemExit) as exErr:
124-
print("\nEnding Example 4")
144+
print("\nEnding Example 1")
125145
sys.exit(0)
146+
126147
```
127148
<p align="center">
128149
<img src="https://cdn.sparkfun.com/assets/custom_pages/3/3/4/dark-logo-red-flame.png" alt="SparkFun - Start Something">

docs/images/gh-banner.png

780 KB
Loading

examples/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Sparkfun ALPHANUMERIC Examples Reference
2+
Below is a brief summary of each of the example programs included in this repository. To report a bug in any of these examples or to request a new feature or example [submit an issue in our GitHub issues.](https://github.com/sparkfun/qwiic_alphanumeric_py/issues).
3+
4+
NOTE: Any numbering of examples is to retain consistency with the Arduino library from which this was ported.
5+
6+
## Qwiic Alphanumeric Ex01 Print String
7+
This example shows how to use the print() function to illuminate strings
8+
on the alphanumeric display.
9+
----------------------------------------------------------------------
10+
11+
## Qwiic Alphanumeric Ex02 Turn On One Segment
12+
This example tests illuminating individual segments of the display. Pass
13+
in the segment and digit you wish to illuminate into illuminate_segment().
14+
----------------------------------------------------------------------
15+
16+
## Qwiic Alphanumeric Ex03 Print Char
17+
This example tests illuminating a whole character on the 14-segment display.
18+
----------------------------------------------------------------------
19+
20+
## Qwiic Alphanumeric Ex04 Set Brightness
21+
This example sets the brightness of the Qwiic Alphanumeric display.
22+
----------------------------------------------------------------------
23+
24+
## Qwiic Alphanumeric Ex05 Set Blink Rate
25+
This example sets the blink rate of the display.
26+
----------------------------------------------------------------------
27+
28+
## Qwiic Alphanumeric Ex06 Colon And Decimal
29+
This example tests the library's response to printing colons or decimal points.
30+
----------------------------------------------------------------------
31+
32+
## Qwiic Alphanumeric Ex07 Unknown Char
33+
This example demonstrates what the library does when the user tries to
34+
print an unknown character.
35+
----------------------------------------------------------------------
36+
37+
## Qwiic Alphanumeric Ex08 Multi Display
38+
This example demonstrates how to connect multiple displays to the bus
39+
to print longer strings.
40+
----------------------------------------------------------------------
41+
42+
## Qwiic Alphanumeric Ex09 Scrolling String
43+
This example tests the scrolling functionality of the display.
44+
----------------------------------------------------------------------
45+
46+

pyproject.toml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
4+
[project]
5+
name = "sparkfun_qwiic_alphanumeric"
6+
version = "0.0.4"
7+
description = long_description
8+
readme = "DESCRIPTION.rst"
9+
10+
authors = [{name="Sparkfun Electronics", email="info@sparkfun.com"}]
11+
dependencies = ["sparkfun_qwiic_i2c"]
12+
13+
classifiers=[
14+
# How mature is this project? Common values are
15+
# 3 - Alpha
16+
# 4 - Beta
17+
# 5 - Production/Stable
18+
"Development Status :: 5 - Production/Stable",
19+
20+
# Indicate who your project is intended for
21+
"Intended Audience :: Developers",
22+
"Topic :: Software Development :: Build Tools",
23+
24+
# Pick your license as you wish (should match "license" above)
25+
"License :: OSI Approved :: MIT License",
26+
27+
# Specify the Python versions you support here. In particular, ensure
28+
# that you indicate whether you support Python 2, Python 3 or both.
29+
"Programming Language :: Python :: 3.5",
30+
"Programming Language :: Python :: 3.6",
31+
"Programming Language :: Python :: 3.7",
32+
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
"Programming Language :: Python :: 3.12",
37+
"Programming Language :: Python :: 3.13",
38+
"Programming Language :: Python :: 3.14",
39+
"Programming Language :: Python :: Implementation :: MicroPython",
40+
# NOTE: CircuitPython is also supported, but no classifier exists for it
41+
]
42+
43+
keywords = ["electronics, maker"]
44+
45+
[project.urls]
46+
homepage = "https://www.sparkfun.com/products/16916"
47+
48+
[tool.setuptools]
49+
py-modules = ["qwiic_alphanumeric"]

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)