Skip to content

Commit 811c47a

Browse files
Revert "Autogenerated. Convert PyPi packaging and add Readme Updates"
This reverts commit 3676a50. Packaging is not yet published.
1 parent 3676a50 commit 811c47a

File tree

6 files changed

+177
-152
lines changed

6 files changed

+177
-152
lines changed

README.md

Lines changed: 74 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,99 @@
1-
![Qwiic 9DOF - Python Package](docs/images/gh-banner.png "qwiic 9DOF Python Package")
1+
Qwiic_9DoF_IMU_ICM20948_Py
2+
==============
23

3-
# SparkFun Qwiic 9DOF - Python Package
4-
5-
![PyPi Version](https://img.shields.io/pypi/v/sparkfun_qwiic_9dof_imu_icm20948)
6-
![GitHub issues](https://img.shields.io/github/issues/sparkfun/qwiic_9dof_imu_icm20948_py)
7-
![License](https://img.shields.io/github/license/sparkfun/qwiic_9dof_imu_icm20948_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_9dof_imu_icm20948_py/classqwiic__icm20948_1_1_qwiic_icm20948.html)
10-
11-
The SparkFun Qwiic 9 Degrees of Freedom IMU 9DOF Module provides a simple and cost effective solution for adding 9 Degrees of Freedom IMU 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.
12-
13-
This repository implements a Python package for the SparkFun Qwiic 9DOF. This package works with Python, MicroPython and CircuitPython.
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-icm20948/" alt="Package">
10+
<img src="https://img.shields.io/pypi/pyversions/sparkfun_qwiic_icm20948.svg" /></a>
11+
<a href="https://github.com/sparkfun/Qwiic_9DoF_IMU_ICM20948_Py/issues" alt="Issues">
12+
<img src="https://img.shields.io/github/issues/sparkfun/Qwiic_9DoF_IMU_ICM20948_Py.svg" /></a>
13+
<a href="https://qwiic-9dof-imu-icm20948-py.readthedocs.io/en/latest/?" alt="Documentation">
14+
<img src="https://readthedocs.org/projects/qwiic-9dof-imu-icm20948-py/badge/?version=latest&style=flat" /></a>
15+
<a href="https://github.com/sparkfun/Qwiic_9DoF_IMU_ICM20948_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>
20+
21+
</p>
1422

15-
### Contents
23+
<img src="https://cdn.sparkfun.com//assets/parts/1/3/8/6/0/15335-SparkFun_9DoF_IMU_Breakout_-_ICM-20948__Qwiic_-01b.jpg" align="right" width=300 alt="SparkFun 9DoF IMU Breakout - ICM-20948 (Qwiic)">
1624

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_9dof_imu_icm20948_py/classqwiic__icm20948_1_1_qwiic_icm20948.html)
22-
* [Examples](#examples)
25+
Python module for the qwiic ICM-20948 sensor, which is included on the [SparkFun 9DoF IMU Breakout - ICM-20948 (Qwiic)](https://www.sparkfun.com/products/15335)
2326

24-
## About the Package
27+
This python package is a port of the existing [SparkFun ICM-20948 Arduino Library](https://github.com/sparkfun/SparkFun_ICM-20948_ArduinoLibrary)
2528

26-
This python package enables the user to access the features of the 9DOF via a single Qwiic cable. This includes <reading acceleration, reading gyroscope, reading magnetometer, reading temperature> and more. The capabilities of the 9DOF are each demonstrated in the included examples.
29+
This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)
2730

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

30-
### Supported SparkFun Products
33+
## Contents
3134

32-
This Python package supports the following SparkFun qwiic products on Python, MicroPython and Circuit python.
33-
34-
* [SparkFun 9 Degrees of Freedom IMU Sensor - 9DOF](https://www.sparkfun.com/products/15318)
35-
36-
### Supported Platforms
37-
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)
43-
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.
46-
47-
## Installation
48-
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
35+
* [Supported Platforms](#supported-platforms)
36+
* [Dependencies](#dependencies)
37+
* [Installation](#installation)
38+
* [Documentation](#documentation)
39+
* [Example Use](#example-use)
5440

55-
The package is primarily installed using the `pip3` command, downloading the package from the Python Index - "PyPi".
41+
Supported Platforms
42+
--------------------
43+
The qwiic ICM20948 Python package current supports the following platforms:
44+
* [Raspberry Pi](https://www.sparkfun.com/search/results?term=raspberry+pi)
45+
* [NVidia Jetson Nano](https://www.sparkfun.com/products/15297)
46+
* [Google Coral Development Board](https://www.sparkfun.com/products/15318)
5647

57-
Note - the below instructions outline installation on a Linux-based (Raspberry Pi) system.
48+
Dependencies
49+
---------------
50+
This driver package depends on the qwiic I2C driver:
51+
[Qwiic_I2C_Py](https://github.com/sparkfun/Qwiic_I2C_Py)
5852

59-
First, setup a virtual environment from a specific directory using venv:
60-
```sh
61-
python3 -m venv path/to/venv
62-
```
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).
53+
Documentation
54+
-------------
55+
The SparkFun qwiic ICM20948 module documentation is hosted at [ReadTheDocs](https://qwiic-9dof-imu-icm20948-py.readthedocs.io/en/latest/?)
6456

65-
Next, install the qwiic package with:
66-
```sh
67-
path/to/venv/bin/pip3 install sparkfun-qwiic-icm20948
68-
```
69-
Now you should be able to run any example or custom python scripts that have `import qwiic_icm20948` by running e.g.:
70-
```sh
71-
path/to/venv/bin/python3 example_script.py
72-
```
57+
Installation
58+
-------------
7359

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.
60+
### PyPi Installation
61+
This repository is hosted on PyPi as the [sparkfun-qwiic-icm20948](https://pypi.org/project/sparkfun-qwiic-icm20948/) package. On systems that support PyPi installation via pip, this library is installed using the following commands
7662

77-
Connect a device with MicroPython installed to your computer and then install the package directly to your device with mpremote mip.
63+
For all users (note: the user must have sudo privileges):
7864
```sh
79-
mpremote mip install github:sparkfun/qwiic_9dof_imu_icm20948_py
65+
sudo pip install sparkfun-qwiic-icm20948
8066
```
67+
For the current user:
8168

82-
If you would also like to install the examples for this repository, issue the following mip command as well:
8369
```sh
84-
mprmeote mip install github:sparkfun/qwiic_9dof_imu_icm20948_py@examples
70+
pip install sparkfun-qwiic-icm20948
8571
```
8672

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.
73+
### Local Installation
74+
To install, make sure the setuptools package is installed on the system.
8975

90-
Ensure that you have the latest version of the SparkFun Qwiic CircuitPython bundle.
76+
Direct installation at the command line:
9177
```sh
92-
circup bundle-add sparkfun/Qwiic_Py
78+
python setup.py install
9379
```
9480

95-
Finally, connect a device with CircuitPython installed to your computer and then install the package directly to your device with circup.
81+
To build a package for use with pip:
9682
```sh
97-
circup install --py qwiic_icm20948
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-
83+
python setup.py sdist
84+
```
85+
A package file is built and placed in a subdirectory called dist. This package file can be installed using pip.
10286
```sh
103-
circup example qwiic_icm20948\ex1_qwiic_ICM20948
87+
cd dist
88+
pip install sparkfun_qwiic_icm20948-<version>.tar.gz
89+
10490
```
105-
10691
Example Use
10792
---------------
108-
Below is a quickstart program to print readings from the 9DOF.
109-
110-
See the examples directory for more detailed use examples and [examples/README.md](https://github.com/sparkfun/qwiic_9dof_py/blob/main/examples/README.md) for a summary of the available examples.
93+
See the examples directory for more detailed use examples.
11194

11295
```python
113-
96+
from __future__ import print_function
11497
import qwiic_icm20948
11598
import time
11699
import sys
@@ -126,20 +109,20 @@ def runExample():
126109
return
127110

128111
IMU.begin()
129-
112+
130113
while True:
131114
if IMU.dataReady():
132115
IMU.getAgmt() # read all axis and temp from sensor, note this also updates all instance variables
133116
print(\
134-
'ax: {: 06d}'.format(IMU.axRaw)\
135-
, '\t', 'ay: {: 06d}'.format(IMU.ayRaw)\
136-
, '\t', 'az: {: 06d}'.format(IMU.azRaw)\
137-
, '\t', 'gx: {: 06d}'.format(IMU.gxRaw)\
138-
, '\t', 'gy: {: 06d}'.format(IMU.gyRaw)\
139-
, '\t', 'gz: {: 06d}'.format(IMU.gzRaw)\
140-
, '\t', 'mx: {: 06d}'.format(IMU.mxRaw)\
141-
, '\t', 'my: {: 06d}'.format(IMU.myRaw)\
142-
, '\t', 'mz: {: 06d}'.format(IMU.mzRaw)\
117+
'{: 06d}'.format(IMU.axRaw)\
118+
, '\t', '{: 06d}'.format(IMU.ayRaw)\
119+
, '\t', '{: 06d}'.format(IMU.azRaw)\
120+
, '\t', '{: 06d}'.format(IMU.gxRaw)\
121+
, '\t', '{: 06d}'.format(IMU.gyRaw)\
122+
, '\t', '{: 06d}'.format(IMU.gzRaw)\
123+
, '\t', '{: 06d}'.format(IMU.mxRaw)\
124+
, '\t', '{: 06d}'.format(IMU.myRaw)\
125+
, '\t', '{: 06d}'.format(IMU.mzRaw)\
143126
)
144127
time.sleep(0.03)
145128
else:
@@ -152,9 +135,6 @@ if __name__ == '__main__':
152135
except (KeyboardInterrupt, SystemExit) as exErr:
153136
print("\nEnding Example 1")
154137
sys.exit(0)
155-
156-
157-
158138
```
159139
<p align="center">
160140
<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

-829 KB
Binary file not shown.

examples/README.md

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

pyproject.toml

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

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal=1

setup.py

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#------------------------------------------------------------------------
2+
#
3+
# This is a python install script written for qwiic python package.
4+
#
5+
# Written by SparkFun Electronics, May 2019
6+
#
7+
# This python library supports the SparkFun Electroncis qwiic
8+
# ecosystem, providing an plaform indepenant interface to the
9+
# I2C bus.
10+
#
11+
# More information on qwiic is at https://www.sparkfun.com/qwiic
12+
#
13+
# Do you like this library? Help support SparkFun. Buy a board!
14+
#
15+
#==================================================================================
16+
# Copyright (c) 2019 SparkFun Electronics
17+
#
18+
# Permission is hereby granted, free of charge, to any person obtaining a copy
19+
# of this software and associated documentation files (the "Software"), to deal
20+
# in the Software without restriction, including without limitation the rights
21+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22+
# copies of the Software, and to permit persons to whom the Software is
23+
# furnished to do so, subject to the following conditions:
24+
#
25+
# The above copyright notice and this permission notice shall be included in all
26+
# copies or substantial portions of the Software.
27+
#
28+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34+
# SOFTWARE.
35+
#==================================================================================
36+
37+
from setuptools import setup, find_packages # Always prefer setuptools over distutils
38+
from os import path
39+
import io
40+
41+
here = path.abspath(path.dirname(__file__))
42+
43+
# get the log description
44+
with io.open(path.join(here, "DESCRIPTION.rst"), encoding="utf-8") as f:
45+
long_description = f.read()
46+
47+
setup(
48+
49+
name='sparkfun_qwiic_icm20948',
50+
51+
# Versions should comply with PEP440. For a discussion on single-sourcing
52+
# the version across setup.py and the project code, see
53+
# http://packaging.python.org/en/latest/tutorial.html#version
54+
version='0.0.1',
55+
56+
description='SparkFun Electronics qwiic ICM20948',
57+
long_description=long_description,
58+
59+
# The project's main homepage.
60+
url='https://www.sparkfun.com/products/15318',
61+
62+
# Author details
63+
author='SparkFun Electronics',
64+
author_email='[email protected]',
65+
66+
install_requires=['sparkfun_qwiic_i2c'],
67+
68+
# Choose your license
69+
license='MIT',
70+
71+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
72+
classifiers=[
73+
# How mature is this project? Common values are
74+
# 3 - Alpha
75+
# 4 - Beta
76+
# 5 - Production/Stable
77+
'Development Status :: 5 - Production/Stable',
78+
79+
# Indicate who your project is intended for
80+
'Intended Audience :: Developers',
81+
'Topic :: Software Development :: Build Tools',
82+
83+
# Pick your license as you wish (should match "license" above)
84+
'License :: OSI Approved :: MIT License',
85+
86+
# Specify the Python versions you support here. In particular, ensure
87+
# that you indicate whether you support Python 2, Python 3 or both.
88+
'Programming Language :: Python :: 2.7',
89+
'Programming Language :: Python :: 3.5',
90+
'Programming Language :: Python :: 3.6',
91+
'Programming Language :: Python :: 3.7',
92+
],
93+
94+
# What does your project relate to?
95+
keywords='electronics, maker',
96+
97+
# You can just specify the packages manually here if your project is
98+
# simple. Or you can use find_packages().
99+
py_modules=["qwiic_icm20948"],
100+
101+
)

0 commit comments

Comments
 (0)