Saravanan666/pypi-org huggingface dataset:
Package: adafruit-circuitpython-dht
IntroductionCircuitPython support for the DHT11 and DHT22 temperature and humidity devices.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.NoteThis library uses thepulseiomodule in CircuitPython. As of CircuitPython 7.0.0,pulseiois
no longer available on the smallest CircuitPython builds,
such as the Trinket M0, Gemma M0, and Feather M0 Basic boards.
You can substitute a more modern sensor, which will work better as well.
See the guideModern Replacements for DHT11 and DHT22 Sensorsfor suggestions.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-dhtTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-dhtTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-dhtUsage ExampleHardware Set-upDesigned specifically to work with the Adafruit DHT series sensors:AdafruitDHT22 temperature-humidity sensor + extrasAdafruitDHT11 temperature-humidity sensor + extrasNoteDHT11 and DHT22 devices both need a pull-resistor on the data signal wire. This resistor is in the range of 1k to 5kPlease check the device datasheet for the appropriate value.Be sure that you are running the Buster Operating System.Make sure that your user is part of thegpiogroup.Known IssuesThe library may or may not work in Linux 64-bit platforms.The Raspberry PI Zero does not provide reliable readings.Readings in FeatherS2 does not work as expected.NoteUsing a more modern sensor will avoid these issues.
See the guideModern Replacements for DHT11 and DHT22 Sensors.BasicsOf course, you must import the library to use it:importadafruit_dhtThe DHT type devices use single data wire, so import the board pinfromboardimport<pin>Now, to initialize the DHT11 device:dht_device=adafruit_dht.DHT11(<pin>)OR initialize the DHT22 device:dht_device=adafruit_dht.DHT22(<pin>)Read temperature and humidityNow get the temperature and humidity valuestemperature=dht_device.temperaturehumidity=dht_device.humidityThese properties may raise an exception if a problem occurs.  You should use try/raise
logic and catch RuntimeError and then retry getting the values after at least 2 seconds.
If you try again to get a result within 2 seconds, cached values are returned.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
Package: adafruit-circuitpython-display-button
IntroductionUI Buttons for displayioDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-display-buttonTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-display-buttonTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-display-buttonUsage ExampleSee examples in examples/ folder.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.Building locallyZip release filesTo build this library locally you’ll need to install thecircuitpython-build-toolspackage.python3-mvenv.venvsource.venv/bin/activatepipinstallcircuitpython-build-toolsOnce installed, make sure you are in the virtual environment:source.venv/bin/activateThen run the build:circuitpython-build-bundles--filename_prefixadafruit-circuitpython-display_button--library_location.Sphinx documentationSphinx is used to build the documentation based on rST files and comments in the code. First,
install dependencies (feel free to reuse the virtual environment from above):python3-mvenv.venvsource.venv/bin/activatepipinstallSphinxsphinx-rtd-themeNow, once you have the virtual environment activated:cddocssphinx-build-E-W-bhtml._build/htmlThis will output the documentation todocs/_build/html. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.
Package: adafruit-circuitpython-displayio-flipclock
IntroductionDisplayIO widgets for showing flip clock style animattions changing from one number to another.DependenciesThis driver depends on:Adafruit CircuitPythonBus DeviceRegisterCedarGrove PaletteFaderThis command can be used to install the PaletteFader:circupinstallcedargrove_palettefaderPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Purchase Feather ESP32-S2 TFT from the Adafruit shopInstalling from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-displayio-flipclockTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-displayio-flipclockTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.env/bin/activatepip3installadafruit-circuitpython-displayio-flipclockInstalling to a Connected CircuitPython Device with CircupMake sure that you havecircupinstalled in your Python environment.
Install it with the following command if necessary:pip3installcircupWithcircupinstalled and your CircuitPython device connected use the
following command to install:circupinstalladafruit_displayio_flipclockOr the following command to update an existing version:circupupdateUsage ExampleimporttimefromdisplayioimportGroupimportboardimportadafruit_imageloadfromadafruit_displayio_flipclock.flip_digitimportFlipDigitANIMATION_DELAY=0.02ANIMATION_FRAME_COUNT=10TRANSPARENT_INDEXES=range(11)BRIGHTER_LEVEL=0.99DARKER_LEVEL=0.5MEDIUM_LEVEL=0.9display=board.DISPLAYmain_group=Group()static_spritesheet,static_palette=adafruit_imageload.load("static_sheet.bmp")static_palette.make_transparent(0)top_animation_spritesheet,top_animation_palette=adafruit_imageload.load("grey_top_animation_sheet.bmp")bottom_animation_spritesheet,bottom_animation_palette=adafruit_imageload.load("grey_bottom_animation_sheet.bmp")foriinTRANSPARENT_INDEXES:top_animation_palette.make_transparent(i)bottom_animation_palette.make_transparent(i)SPRITE_WIDTH=static_spritesheet.width//3SPRITE_HEIGHT=(static_spritesheet.height//4)//2flip_digit=FlipDigit(static_spritesheet,static_palette,top_animation_spritesheet,top_animation_palette,bottom_animation_spritesheet,bottom_animation_palette,SPRITE_WIDTH,SPRITE_HEIGHT,anim_frame_count=ANIMATION_FRAME_COUNT,anim_delay=ANIMATION_DELAY,brighter_level=BRIGHTER_LEVEL,darker_level=DARKER_LEVEL,medium_level=MEDIUM_LEVEL,)flip_digit.anchor_point=(0.5,0.5)flip_digit.anchored_position=(display.width//2,display.height//2)main_group.append(flip_digit)display.root_group=main_groupwhileTrue:foriinrange(10):flip_digit.value=itime.sleep(0.75)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
Package: adafruit-circuitpython-displayio-layout
IntroductionCircuitPython helper library for displayio layouts and widgets.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-displayio-layoutTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-displayio-layoutTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-displayio-layoutUsage ExampleSee scripts in the examples directory of this repository.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
Package: adafruit-circuitpython-displayio-sh1106
IntroductionDisplayIO compatible library for SH1106 OLED displaysDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundleor individual libraries can be installed usingcircup.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI.
To install for current user:pip3installadafruit-circuitpython-displayio-sh1106To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-displayio-sh1106To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-displayio-sh1106Usage Exampleimportbusioimportdisplayioimportterminalioimportfourwirefromadafruit_display_textimportlabelimportadafruit_displayio_sh1106displayio.release_displays()spi=busio.SPI(board.SCK,board.MOSI)display_bus=fourwire.FourWire(spi,command=board.OLED_DC,chip_select=board.OLED_CS,reset=board.OLED_RESET,baudrate=1000000,)WIDTH=128HEIGHT=64BORDER=5display=adafruit_displayio_sh1106.SH1106(display_bus,width=WIDTH,height=HEIGHT)# Make the display contextsplash=displayio.Group()display.root_group=splashcolor_bitmap=displayio.Bitmap(WIDTH,HEIGHT,1)color_palette=displayio.Palette(1)color_palette[0]=0xFFFFFF# Whitebg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,x=0,y=0)splash.append(bg_sprite)# Draw a smaller inner rectangleinner_bitmap=displayio.Bitmap(WIDTH-BORDER*2,HEIGHT-BORDER*2,1)inner_palette=displayio.Palette(1)inner_palette[0]=0x000000# Blackinner_sprite=displayio.TileGrid(inner_bitmap,pixel_shader=inner_palette,x=BORDER,y=BORDER)splash.append(inner_sprite)# Draw a labeltext="Hello World!"text_area=label.Label(terminalio.FONT,text=text,color=0xFFFFFF,x=28,y=HEIGHT//2-1)splash.append(text_area)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
Package: adafruit-circuitpython-displayio-sh1107
IntroductionDisplayIO driver for SH1107 monochrome displays. DisplayIO drivers enable terminal output.DependenciesThis driver depends on:Adafruit CircuitPython Version 6+A new quirk in 6.0 for SH1107An SH1107 OLED display, eg.Adafruit FeatherWing 128 x 64 OLEDPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading theAdafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-displayio-sh1107To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-displayio-sh1107To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-displayio-sh1107Usage Exampleimportboardimportdisplayioimportterminalioimportbitmap_labelaslabel# from adafruit_display_textimportadafruit_displayio_sh1107displayio.release_displays()#oled_reset = board.D9# Use for I2Ci2c=board.I2C()display_bus=displayio.I2CDisplay(i2c,device_address=0x3C)# SH1107 is vertically oriented 64x128WIDTH=128HEIGHT=64BORDER=2display=adafruit_displayio_sh1107.SH1107(display_bus,width=WIDTH,height=HEIGHT)# Make the display contextsplash=displayio.Group()display.root_group=splashcolor_bitmap=displayio.Bitmap(WIDTH,HEIGHT,1)color_palette=displayio.Palette(1)color_palette[0]=0xFFFFFF# Whitebg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,x=0,y=0)splash.append(bg_sprite)# Draw a smaller inner rectangle in blackinner_bitmap=displayio.Bitmap(WIDTH-BORDER*2,HEIGHT-BORDER*2,1)inner_palette=displayio.Palette(1)inner_palette[0]=0x000000# Blackinner_sprite=displayio.TileGrid(inner_bitmap,pixel_shader=inner_palette,x=BORDER,y=BORDER)splash.append(inner_sprite)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
Package: adafruit-circuitpython-displayio-ssd1305
IntroductionDisplayIO driver for SSD1305 monochrome displaysFor the framebuf based driver seeAdafruit CircuitPython SSD1305.DependenciesThis driver depends on:Adafruit CircuitPython Version 5+Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-displayio-ssd1305To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-displayio-ssd1305To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-displayio-ssd1305Usage Exampleimportboardimportdisplayio# Starting in CircuitPython 9.x fourwire will be a seperate internal library# rather than a component of the displayio librarytry:fromfourwireimportFourWire# Use for I2C#    from i2cdisplaybus import I2CDisplayBusexceptImportError:fromdisplayioimportFourWire# from displayio import I2CDisplay as I2CDisplayBusimportterminaliofromadafruit_display_textimportlabelimportadafruit_displayio_ssd1305displayio.release_displays()# Use for SPIspi=board.SPI()oled_cs=board.D5oled_dc=board.D6display_bus=FourWire(spi,command=oled_dc,chip_select=oled_cs,baudrate=1000000,reset=board.D9)# Use for I2C# i2c = board.I2C()## display_bus = I2CDisplayBus(i1c, device_address=0x3c)WIDTH=128HEIGHT=64# Change to 32 if neededBORDER=8FONTSCALE=1display=adafruit_displayio_ssd1305.SSD1305(display_bus,width=WIDTH,height=HEIGHT)# Make the display contextsplash=displayio.Group()display.root_group=splashcolor_bitmap=displayio.Bitmap(display.width,display.height,1)color_palette=displayio.Palette(1)color_palette[0]=0xFFFFFF# Whitebg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,x=0,y=0)splash.append(bg_sprite)# Draw a smaller inner rectangleinner_bitmap=displayio.Bitmap(display.width-BORDER*2,display.height-BORDER*2,1)inner_palette=displayio.Palette(1)inner_palette[0]=0x000000# Blackinner_sprite=displayio.TileGrid(inner_bitmap,pixel_shader=inner_palette,x=BORDER,y=BORDER)splash.append(inner_sprite)# Draw a labeltext="Hello World!"text_area=label.Label(terminalio.FONT,text=text,color=0xFFFFFF)text_width=text_area.bounding_box[2]*FONTSCALEtext_group=displayio.Group(scale=FONTSCALE,x=display.width//2-text_width//2,y=display.height//2)text_group.append(text_area)# Subgroup for text scalingsplash.append(text_group)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
Package: adafruit-circuitpython-displayio-ssd1306
IntroductionDisplayIO driver for SSD1306 monochrome displays. DisplayIO drivers enable terminal outputFor the framebuf based driver seeAdafruit CircuitPython SSD1306.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-displayio-ssd1306To install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-displayio-ssd1306To install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-displayio-ssd1306Usage Exampleimportboardimportdisplayioimportadafruit_displayio_ssd1306importbusiodisplayio.release_displays()# This pinout works on a Metro and may need to be altered for other boards.spi=busio.SPI(board.SCL,board.SDA)tft_cs=board.D9tft_dc=board.D8tft_reset=board.D7display_bus=displayio.FourWire(spi,command=tft_dc,chip_select=tft_cs,reset=tft_reset,baudrate=1000000)display=adafruit_displayio_ssd1306.SSD1306(display_bus,width=128,height=64)DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
Package: adafruit-circuitpython-display-notification
IntroductionDisplayio Widgets for displaying notificationsDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPINoteThis library is not available on PyPI yet. Install documentation is included
as a standard element. Stay tuned for PyPI availability!On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-display-notificationTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-display-notificationTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-display-notificationUsage ExampleSee theexamplesfolder.DocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.
Package: adafruit-circuitpython-display-shapes
IntroductionVarious common shapes for use with displayioDependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Installing from PyPIOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locallyfrom
PyPI. To install for current user:pip3installadafruit-circuitpython-display_shapesTo install system-wide (this may be required in some cases):sudopip3installadafruit-circuitpython-display_shapesTo install in a virtual environment in your current project:mkdirproject-name&&cdproject-namepython3-mvenv.venvsource.venv/bin/activatepip3installadafruit-circuitpython-display_shapesUsage Exampleimportboardimportdisplayiofromadafruit_display_shapes.rectimportRectfromadafruit_display_shapes.circleimportCirclefromadafruit_display_shapes.arcimportArcfromadafruit_display_shapes.roundrectimportRoundRectsplash=displayio.Group()board.DISPLAY.root_group=splashcolor_bitmap=displayio.Bitmap(320,240,1)color_palette=displayio.Palette(1)color_palette[0]=0xFFFFFFbg_sprite=displayio.TileGrid(color_bitmap,pixel_shader=color_palette,position=(0,0))print(bg_sprite.position)splash.append(bg_sprite)triangle=Triangle(170,50,120,140,210,160,fill=0x00FF00,outline=0xFF00FF)splash.append(triangle)rect=Rect(80,20,41,41,fill=0x0)splash.append(rect)circle=Circle(100,100,20,fill=0x00FF00,outline=0xFF00FF)splash.append(circle)arc=Arc(x=100,y=100,radius=25,angle=45,direction=90,segments=10,outline=0x00FF00)splash.append(arc)rect2=Rect(50,100,61,81,outline=0x0,stroke=3)splash.append(rect2)roundrect=RoundRect(10,10,61,81,10,fill=0x0,outline=0xFF00FF,stroke=6)splash.append(roundrect)whileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.Building locallyZip release filesTo build this library locally you’ll need to install thecircuitpython-build-toolspackage.python3-mvenv.venvsource.venv/bin/activatepipinstallcircuitpython-build-toolsOnce installed, make sure you are in the virtual environment:source.venv/bin/activateThen run the build:circuitpython-build-bundles--filename_prefixadafruit-circuitpython-display_shapes--library_location.Sphinx documentationSphinx is used to build the documentation based on rST files and comments in the code. First,
install dependencies (feel free to reuse the virtual environment from above):python3-mvenv.venvsource.venv/bin/activatepipinstallSphinxsphinx-rtd-themeNow, once you have the virtual environment activated:cddocssphinx-build-E-W-bhtml._build/htmlThis will output the documentation todocs/_build/html. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.
Package: adafruit-circuitpython-display-text
IntroductionDisplays text using CircuitPython’s displayio.DependenciesThis driver depends on:Adafruit CircuitPythonPlease ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloadingthe Adafruit library and driver bundle.Usage ExampleFor a board with a built-in display.importboardimportterminaliofromadafruit_display_textimportlabeltext="Hello world"text_area=label.Label(terminalio.FONT,text=text)text_area.x=10text_area.y=10board.DISPLAY.root_group=text_areawhileTrue:passDocumentationAPI documentation for this library can be found onRead the Docs.For information on building library documentation, please check outthis guide.ContributingContributions are welcome! Please read ourCode of Conductbefore contributing to help this project stay welcoming.