Skip to main content

grove.py

Build Status

Python library for Seeedstudio Grove Devices on embeded Linux platform, especially good on below platforms:



Architecture

To operate grove sensors, the grove.py depends on the smbus2 hardware interface library.




Installation

For beginner or library user only, please install with online method.
For developer or advanced user, please install dependencies and then install grove.py with source code.

Online install

To install into a virtual environment, first active your virtualenv and type the following command:

curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | bash -s -- --user-local --bypass-gui-installation

If you want to install into the system, you can type the following command:

curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -

Install grove.py

From source code

git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
# Python3 
sudo pip3 install .
# virutalenv for Python3 (If the installation fails when using pip3)
sudo apt install python3-virtualenv
virtualenv -p python3 env
source env/bin/activate
pip3 install .



Usage

Basic GPIO Input & Output demo

import time
from grove.gpio import GPIO

led = GPIO(12, GPIO.OUT)
button = GPIO(22, GPIO.IN)

while True:
    if button.read():
        led.write(1)
    else:
        led.write(0)
    time.sleep(0.1)

See more demos and how to run



API Documentation

click here

how to update me



Contribution

Check list for adding a new grove device, for simple, take grove_led as a example.

  • Add a Class in the python source file, and export with __all__ =
  • Code sytle PEP8 is recommanded
  • The python source could run directly with python <file> and python3 <file>
  • Add demo code at the near top of source file
  • The demo code could run directly with someone python/python3 IDE.
  • Add document to class and it's member and show the result by refering to API document
  • Add a command item in setup.py console_scripts list, take effect by install again
  • Add a item to command table in Usage Doc
  • If the command need argument but not specified, please list available arguments.
  • If specified invalid argument, also output usage document then exit.

Release files for Seeed-grove.py 0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Seeed-grove.py 0.8
File Size Uploaded
Seeed-grove.py-0.8.tar.gz 84.8 kB Details

Release files / Seeed-grove.py-0.8.tar.gz

Download URL Seeed-grove.py-0.8.tar.gz
Size 84.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d34748ce6b2a11a85dd4d0a76361eea020771e19a931b0b86c0549f98f241673
BLAKE2b-256 checksum
How to use checksums
265870db47020012f829b3912bb21ef032dbf2aabcdfb7cf54675c1138699945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.8 This release

1 release file

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page