Saravanan666/pypi-org huggingface dataset:
Package: rpicammqtt-client
# rpi-cam-mqtt-clientClient library to control a raspberry PI camera through MQTT.Provides high level methods to control a raspberry PI camera:get_cmd_listget_cmd_inforun_commandget_statusget_ptviewsis_activeis_ptview_availableis_recordingis_detecting_motionset_camera_statusset_motion_detection_statusstart_videostop_videotake_pictureset_exposure_modeset_wb_modeset_metering_modeset_image_effectset_pantiltThe camera needs to have the RPi-Cam-Web-Interface installed and the MQTT agent running. Checkrpi-cam-mqtt(https://gitlab.com/gbus/rpi-cam-mqtt) project for further details.## InstallationThe library can be installed and called in a python module:pip3 install rpicammqtt_clientfrom rpicammqtt_client import RpiCamMqttClient
help(RpiCamMqttClient)## ConfigurationThe configuration file is looked up from:/etc/rpi-cam-mqtt/rpi-cam-mqtt.yaml
$HOME/.rpi-cam-mqtt/rpi-cam-mqtt.yaml
./config/rpi-cam-mqtt.yamlA template can be downloaded from:https://gitlab.com/gbus/rpi-cam-mqtt-client/raw/master/rpicammqtt_client/config/rpi-cam-mqtt.yaml## UseThe main class RpiCamMqttClient needs to have passed a reference to publish/subscribe custom definitions to implement the specific calls to the MQTT library of choice.
One based on the paho mqtt library is provided and can be used for reference:from rpicammqtt_client import RpiCamMqttClient
from rpicammqtt_client.mqtt import MQTTThe RpiCamMqttClient needs therpicamname as configured in the remote agent that controls the camera and a few extra options to change the MQTT behaviour.The main method to use isrun_command, which allows to publish any command as it would normally be sent to the PIPE. More info:https://elinux.org/RPi-Cam-Web-Interface#PipeAdditionally a few higher level methods are provided that simplify the use of the library.
A good starting point is the list of examples described in the next section where it is possible to see the library in action.## ApplicationsExample of applications using the library can be found in the package:https://gitlab.com/gbus/rpi-cam-mqtt-client/tree/master/rpicammqtt_client/examples
Package: rpi-controls
GPIO controller for Raspberry PiThis package provides classes to interact with physical buttons connected to a Raspberry Pi's GPIO. Those classes make it easy to run event-driven callbacks.Brief exampleThe example below illustrates the implementation of a callback to execute asynchronously when clicking a button:fromrpicontrolsimportController,Button,PullType,make_controller# Initialize the button controller. A single instance can handle as many buttons as needed.controller:Controller=make_controller()# Create the button, connected to pin 22.button:Button=controller.make_button(input_pin_id=22,# Id of the GPIO pin the button switch is connected to.input=Button.InputType.PRESSED_WHEN_OFF,# Depends on the physical wiring of the button.pull=PullType.UP# Whether to enable pull-up or pull-down resistor. Use PullType.NONE to disable.)# Define a callback to run when button is clicked.asyncdefon_click_callback(button:Button)->None:print(f'Button{button.name}clicked!')# Run some IO-bound task without blocking.# Other event handlers may run while waiting.awaitasyncio.sleep(2)# Subscribe to the click event.button.add_on_click(on_click_callback)# Start controller main loop. Use controller.start_in_thread() for the non-blocking version.controller.run()Asynchronous callbacks are optional and synchronous ones work just fine. Check out the full documentationherefor all the details.
Package: rpiDAC
Python module to communicate between Raspberry Pi and AD5662 DAC.Example of use:Import DAC16:
from DAC import DAC16Initialize rpi GPIOs:
DIN = 18
SCLK = 11
SYNC = 4
dac = DAC16(SYNC, SCLK, DIN)Write intValue (between 0-65535):
dac.write(intValue)ported from Albert van Dalen’s Arduino library (http://www.avdweb.nl/arduino/hardware-interfacing/16-bit-dac.html).
Package: rpi-devices
This is a Python 3 library for easily setting up devices connected to a
Raspberry Pi. It contains objects and methods for DC motors with and
without software PWM, servos and LEDs.Currently, following objects are available:SimpleMotor: DC Motor with bi-directional rotation (no PWM control)DCMotor: DC Motor with bi-directional rotation and PWM control
methodsServo: Servo with PWM control and configuration methodsLED: LED, Laser Diode or any other device which can be controlled
using a single GPIO output pinInstallation and UsageOption 1 (Recommended) :Usingpip:sudo pip install rpi_devicesor usingsetuptools:git clone https://github.com/munircontractor/raspberry-pi-device-library
cd raspberry-pi-device-library
sudo python3 setup.py installThen, in your code:from rpi_devices import cleanup, <Device>Option 2 :Using directly:Copy therpi_devices/devices.pyfiles to your Raspberry Pi.To use the objects, add the following lines at the top of your code:import sys
sys.path.append("/full/path/to/devices.py")
from devices import cleanup, <Device>-CautionsDo not forget to run the library’scleanupfunction orRPi.GPIO.cleanup()after you are done.Although all the classes in this library allow a different pin numbering
mode during setup, it is strongly recommended to use the same mode
across all devices. The pin numbering mode is set globally, so if
devices are set with different pin numbering modes, code which is not
calling a device method will automatically use the mode of the last
device called, which can lead to undesirable and, at times, harmful behavior.
Package: rpi-dht22-exporter
Raspberry Pi DHT22 Prometheus ExporterExports DHT22 temperature and humidity readings in a format readable by Prometheus.Installationpipinstallrpi-dht-22-exporterRunningrpi-dht22-exporter--pin-number<gpiopinnumber>This will serve metrics athttp://0.0.0.0:9894/metrics.You can make Prometheus scrape these with this scrape config:scrape_configs:-job_name:'dht22@<theIPofyourRaspberryPi>'static_configs:-targets:['<theIPofyourRaspberryPi>:9894']labels:location:'bedroom'2.0.1CLI help test assertion less picky about help format.2.0.0Introduced therpi-dht22-exporterCLI tool.1.0.0Initial release.
Package: rpi-dht22-mqtt
Copyright (c) 2016 David ÜbelackerPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.Description: dht22 to mqtt for Raspberry Pi=============================Reads the temperature and humidity from a dht22 sensors and sends it to a mqtt broker.Installation:-------------------pip install rpi-dht22-mqttConfiguration:-------------------Needs a json configuration file as follows (don't forget to change ip and credentials ;-)):.. code:: json{"mqtt_client_id": "rpi-dht22","mqtt_host": "192.168.0.210","mqtt_port": "1883","verbose": "true","topics": {"temperature": "halti/datacenter/temperature","humidity": "halti/datacenter/humidity",}}Start:-------------------rpi-dht22-mqtt config.jsonPlatform: UNKNOWN
Package: rpi-doorman
Door state monitor, completely written in Python.Doorman is using adafruit magnetic contact switch (door sensor), with Raspberry Pi GPIO. Software might work with other sensors as well but have not been tested.To connect to Raspberry Pi plug into GPIO PIN 16 and POWER PIN. Install and execute doorman and it should work. Alternatively you can user different PIN and execute doorman with parameter:rpi-doorman--pinpin_number.Doorman has support to POST door status change toludolph-doormanplugin. This way jabber notifications can be set easily.InstallationInstall the latest released version using pip:pip install https://github.com/ricco386/rpi-doorman/zipball/masterMake sure all dependencies (listed below) are installed (done automatically when installing via pip)Therpi-doormancommand should be installed somewhere in yourPATH.Systemd scripts are available:https://github.com/ricco386/rpi-doorman/tree/master/init.dSystemd scripts should be run underdefault Raspberry Pi user(pi) so scripts can access GPIO.For jabber notification support, configure Systemd to execute with notify parameter:rpi-doorman--notifyjabber@account.commake sureLudolphis installed and has configuredludolph-doormanplugin.Dependencies:RPi.GPIO(0.6.1+)Optionaly dependencies for jabber support:requests(2.9.1+)ludolph-doorman(1.1+)LicenseFor more information see theLICENSEfile.
Package: rpi-doorman-gammu
RPi.Doorman Gammu#################Door state monitor, with ability to make a phone call completely written in Python... image:: https://badge.fury.io/py/rpi-doorman-gammu.png:target: http://badge.fury.io/py/rpi-doorman-gammuThis is just and extension for RPi.Doorman project to support python-gammu. With aditional dependencies this project allows to make a phone calls when sensor state changes.For more information check `rpi-doorman <https://github.com/ricco386/rpi-doorman/>`_ project.Installation------------- Install the latest released version using pip::pip install https://github.com/ricco386/rpi-doorman-gammu/zipball/master- Make sure all dependencies (listed below) are installed (done automatically when installing via pip)- The ``rpi-doorman-gammu`` command should be installed somewhere in your ``PATH``.- Systemd scripts are available: https://github.com/ricco386/rpi-doorman-gammu/tree/master/init.dSystemd scripts should be run under **default Raspberry Pi user** (pi) so scripts can access GPIO.**Dependencies:**- `RPi.GPIO <https://pypi.python.org/pypi/RPi.GPIO>`_ (0.6.1+)- `rpi-doorman <https://pypi.python.org/pypi/rpi-doorman>`_ (1.1+)- `gammu <https://github.com/gammu/gammu>`_ and `python-gammu <https://github.com/gammu/python-gammu>`_ (``sudo apt-get install gammu python-gammu``)License-------For more information see the `LICENSE <https://github.com/ricco386/rpi-doorman-gammu/blob/master/LICENSE>`_ file.
Package: rpi-dots
PyGame app to interact with theDots boardfor theRaspberry Piused as aconnect the dotspuzzle.InstallationOn Raspberry Pi, install therpi_dotsmodule in pip.Python 3:sudo apt-get install python3-pip
sudo pip-3.2 install rpi_dotsPython 2:sudo apt-get install python-pip
sudo pip install rpi_dotsUsageRun from the command line:sudo rpi_dotsContributorsEben UptonBen NuttallOpen SourceThe code is licensed under theBSD LicenceThe project source code is hosted onGitHubPlease useGitHub issuesto submit bugs and report issues
Package: rpi-dots-minecraft
A Python (2.7) based script for use with the Raspberry Pi Foundation
Dots Boards and Minecraft Pi.The program reads the status of the dots and generates an airplane
inside Minecraft Pi based on the dots painted. This plane then
attempts to fly in the game.Installation from PyPi (Recommended)On the Raspberry Pi, open a terminal and enter -sudoapt-getinstallpython-pipFollowed by -sudo pip install rpi_dots_minecraftOpen Minecraft Pi and create a new worldFinally, to run it use -sudo rpi_dots_minecraftInstallation from GithubClone the github repository -git clonehttps://github.com/gbaman/rpi-dots-minecraft.gitChange navigate to the folder -cdrpi-dots-minecraftRun the program with -sudo python scripts/rpi_dots_minecraftLicenseThe project is licensed under the MIT license. See the LICENSE file for
a full copy of the license.
Package: rpi-flash
rpi-flashScript to flash and configure a disk image. Image may be local or via http, and may be gz compressed. To minimise flash writes, each block is read and compared first.Made specifically for my Raspberry Pi flashing process, it may not be suitable for you. Currently supports macOS only.ConfiguratonConfiguration assumes a partition with.configure_mein its root. If not found this will be skipped.
The configuration is compatible with my customrpi-baseimage.Run with--write-envto generate a .env file with variables and docs.
Package: rpi-gpio-devices
rpi-gpio-devicesControl Raspberry Pi gpio pins more easily.This module provides an abstraction layer to control connected devices
(fans, switches, LEDs, buttons) more easily with ready to use device classes and functions.It uses theRPi.GPIOmodule to control the GPIO pins.
Currently this is the recommended module to use for archlinuxarm, but it only provides
basic functions to manipulate the pins.Installationpip install rpi-gpio-devicespypiFew examplesAutomatic fan control based on CPU tempfromtimeimportsleepfromrpi_gpio_devicesimportFan# Basic usagepwm_fan=Fan(power=29,sense=35,pwm=33)try:whileTrue:pwm_fan.auto_set()exceptKeyboardInterrupt:pwm_fan.cleanup()Set LED brightness with PWMfromtimeimportsleepfromrpi_gpio_devicesimportPWMLEDpwmled=PWMLED(33)pwmled.set_brightness(50)sleep(2)pwmled.set_brightness(100)sleep(2)pwmled.set_brightness(0)# pwmled.turn_off() # Or simply just turn it offpwmled.cleanup()Check if a button is pressedfromtimeimportsleepfromrpi_gpio_devicesimportButtonbutton=Button(11)try:whileTrue:ifbutton.is_pressed():print('Button is pressed!')sleep(0.5)exceptKeyboardInterrupt:button.cleanup()More in theexamplesdirectory.
Package: rpi-gpio-emu
This package provides placeholders to emulate the RPi.GPIO package functions on other devices.The expected output from the functions “input”, “getmode”, “event_detected”, and the delay time in seconds for “wait_for_edge” can be set using the “out” keyword argument.
The output for these functions is random otherwise, except for “wait_for_edge” which is 1 second.The remaining functions “add_event_callback”, “add_event_detect”, “cleanup”, “getmode”, “gpio_function”, “output”, “remove_event_detect”, “setmode”, “setup”, and “setwarnings” do nothing.For examples and documentation of RPi.GPIO, visithttp://sourceforge.net/p/raspberry-gpio-python/wiki/Home/Project page:https://github.com/aharshac/rpi-gpio-emuChange Log0.0.1Based on RPi.GPIO 0.6.5
Package: rpi-greenhouse
Python module forRaspberry Piplantpot greenhouse add-on board produced byRachel Rayns. The library provides a simple interface to logging data from the board’s sensors, controlling the board’s LEDs and using them to display information from the sensors.ComponentsSensorsTemperature and Humidity sensor (DHT22)Soil Moisture sesnsorLight sensor (LDR)LEDs3x white3x red3x blue3x greenRTCReal Time Clock (DS1307)InstallationInstall the dependencies and installrpi-greenhousewithpip.See fullinstallation instructions.Python 3 is not currently supported due to a Python 2 -only dependency. This will be resolved as a priority to add Python 3 support.DocumentationComprehensive documentation available atpythonhosted.org/rpi-greenhouseContributorsBen NuttallTom HartleyLuke WrenOpen SourceThe code is licensed under theBSD LicenceThe project source code is hosted onGitHubPlease useGitHub issuesto submit bugs and report issues
Package: rpi-hardware-pwm
rpi hardware pwmAccess the hardware PWM of a Raspberry Pi with Python. More lightweight than alternatives.InstallationOn the Raspberry Pi, adddtoverlay=pwm-2chanto/boot/config.txt. This defaults toGPIO_18as the pin forPWM0andGPIO_19as the pin forPWM1.Alternatively, you can changeGPIO_18toGPIO_12andGPIO_19toGPIO_13usingdtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4.Reboot your Raspberry Pi.You can check everything is working on runninglsmod | grep pwmand looking forpwm_bcm2835Install this library:sudo pip3 install rpi-hardware-pwmExamplesFor Rpi 1,2,3,4, use chip=0; For Rpi 5, use chip=2fromrpi_hardware_pwmimportHardwarePWMpwm=HardwarePWM(pwm_channel=0,hz=60,chip=0)pwm.start(100)# full duty cyclepwm.change_duty_cycle(50)pwm.change_frequency(25_000)pwm.stop()HistoryThe original code is fromjdimpson/syspwm, We've updated it to Python3 and
made it look like theRPi.GPIOlibrary's API (but more Pythonic than that.), and we use it inPioreactorbioreactor system.
Package: rpi-ip-bot-client
This is the client side of Telegram@rpi_ip_bot.This bot was designed to help you track IP-address of your Raspberry Pi 3 or any other connected device if, for some reasons, it doesn’t have static IP, isn’t connected to VPN and you’re too lazy to scan network or get into router control panel every time you need to get the remote access to your Linux device.Telegram bot descriptionInstallationFrom PyPI:pip install rpi_ip_bot_clientFrom this repository:git clone https://github.com/eugene-babichenko/rpi_ip_bot_client.gitcd rpi_ip_bot_clientpip install .UsageTo install the script typerpiipbot install <TOKEN>, where <TOKEN> is one of the tokens, generated by the bot.If you want to stop using the bot on this machine, just typerpiipbot uninstall.By default the script is installed to/etc/network/if-up.dso it’s automatically run when any network connection is present.
To install it to another directory pass–dir <dirname>.
Package: rpi-kms
PykmsThis package is for the pykms bindings for kms++. It requires you to already havekms++-utilsinstalled on your system.CaveatsFor most users this package is not the best approach to use kms++ in python - there are simpler waysIf you are able to use the system python, then runningsudo apt install -y python3-kms++will install pykms in the simplest way.If you do require a virtual environment(for example, in order to use a python package not available through apt) then the simplest way is to install the apt package and then create a virtual environment using system-site-packages.sudo apt install -y python3-kms++
python3 -m venv --system-site-packages my-envThis will allow you to use pip to install other packages in the virtual environment, while using the system versions of packages such as pykms and PyQt5, which is a much simpler approach than pip installing these packages.If you must use this packagethen be aware that there may be other troubleshooting required to get your virtual environment working correctly. For example, packages such as PyQt5 and OpenCV can require additional steps in order to pip install them, so it is much easier to apt install them and use a virtual environment with system-site-packages. If you have no other option but to use an isolated virtual environment (for example, if you require a different version of python to the system installed version), then this package will help with installing pykms, but be warned that other packages related to the camera/display will not be as easy to install.Installation InstructionsThese instructions are designed for use in a python virtual environment. If you are using the system python then it is simpler to install the system apt package for pykms (egsudo apt install python3-kms++).The default installations instructions are:sudo apt install -y libkms++-dev libfmt-dev libdrm-dev
pip install rpi-kmsIf that doesn't work...If you're building your own version of kms++ to be more up to date than your system release, then you may need to pass the repository and revision into meson. The arguments to do this are-C setup-args="-Drepository=https://my.repository.git"for the repository and-C setup-args="-Drevision=branch"for the revision. These are passed directly intogit cloneandgit checkoutrespectively, so and strings that work with those will work here. The-C, --config-settingsargument require an up to date version ofpip>=23.1so you may first need to runpip install --upgrade pipYou may also need to create a custom pypatch.patch, but at that point it is probably simpler to just clone the entire repository, edit the patch locally, and install the local folder withpip install ./pykms/. If you really want then your custom patch can be passed in with-C setup-args="-Dpatch=/home/me/mypatch.patch"- this will need an absolute path as the pip build will run in a temporary directory, so a relative path will not work.
Package: rpi-lgpio
rpi-lgpio is a compatibility package intended to provide compatibility with
therpi-gpio(aka RPi.GPIO) library, on top of kernels that only support thegpiochip device(and which have removed thedeprecated sysfs GPIO
interface).WarningYoucannotinstall rpi-lgpio andrpi-gpio(aka RPi.GPIO, the library
it emulates) at the same time, in the same Python environment. Both
packages attempt to install a module namedRPi.GPIOand obviously this
will not work.
Package: rpi-mini-battery-display
RPi Mini Battery DisplayLibrary and command-line program to control 10-segment mini battery displays based on the TM1651 chip, such asthe ones from Open-Smart, on a Raspberry Pi.System requirementsThe rpi-mini-battery-display library is written to run on a Raspberry Pi. It has been tested on Raspbian Buster (10) with Python 3.7.If you don't have pip, install it first with:sudoaptinstallpython3-pipThis library uses theRPi.GPIOlibrary to communicate with the TM1651 chip. The default userpiin Raspbian has already the right permissions for GPIO access. If you want to use the library as another user, the user needs to be in thegpiogroup to have the right permissions. This can be done with:sudoadduser$USERgpioInstallationsudopip3installrpi-mini-battery-displayConnectionsThe mini battery display should be connected like this to the Raspberry Pi's GPIO header:Mini Battery DisplayRaspberry PiCLKBCM24DIOBCM23VCC5 VGNDGNDSeepinout.xyzfor the Raspberry Pi GPIO pinout.The CLK and DIO pin can be connected to other pins on the Raspberry Pi, but these are the default values used by the code. If you change the connections, you have to supply the other pin values as parameters to the software.UsageYou can use therpi-mini-battery-displayprogram to set the level of the battery display from 0 to 7 or to let it show the CPU percentage as a level from 0 (less than 12.5%) to 7 (more than 87.5%):usage:rpi-mini-battery-display[-h][-cCLOCK_PIN][-dDATA_PIN][-bBRIGHTNESS](-lLEVEL|-p)Controla10LEDminibatterydisplaywithTM1651chip

optionalarguments:-h,--helpshowthishelpmessageandexit-cCLOCK_PIN,--clock-pinCLOCK_PINClockpininBCMnotation(default:24,range:0-27)-dDATA_PIN,--data-pinDATA_PINDatapininBCMnotation(default:23,range:0-27)-bBRIGHTNESS,--brightnessBRIGHTNESSBrightness(default:2,range:0-7)-lLEVEL,--levelLEVELSetbatterylevel(range:0-7)-p,--processorShowCPUpercentageUse casesThese displays are handy in every situation where you want to show a status on a Raspberry Pi on a low budget. For instance, I'm using them to show the CPU load of every Raspberry Pi in my six-node cluster:This was actually my motivation to develop the rpi-mini-battery-display library.Changelog0.3.0 (2020-02-28): Refactored code from rather C++/Arduino-like to something more Pythonic0.2.0 (2020-01-27): Added option to show the CPU percentage0.1.0 (2020-01-26): Initial versionTODOIndividually address the LED segments instead of only using them as a LED bar (fairly trivial, I already played with it but haven't implemented the necessary method yet).Add the possibility to switch the direction of the LED bar.Add static typing withmypy.Support other versions of the mini battery displays based on the TM1651 chip, for instancethe 5-segment one.Support other mini battery displays, such as theGrove LED Bar, which uses the MY9221 chip.Developer notesThe TM1651 is one of a series of LED driver control chips by Titan Micro Electronics. Other popular similar chips of the same manufacturer are the TM1637 and TM1640.English datasheet of the TM1651LicenseThis project is provided byKoen Vervloesemas open source software with the MIT license. See the LICENSE file for more information.