Skip to main content

Python's itertools for CircuitPython

Project description

Introduction

Documentation Status Discord Build Status Code Style: Black

Python’s itertools for CircuitPython

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Usage Example

 import time
 import board
 import busio
 import adafruit_si7021
 from adafruit_itertools.adafruit_itertools import count
 from adafruit_itertools.adafruit_itertools_extras import repeatfunc

 i2c = busio.I2C(board.SCL, board.SDA)
 sensor = adafruit_si7021.SI7021(i2c)

 def read_temperature():
     return sensor.temperature

def now():
    return time.monotonic()

 datapoints = zip(count(1), repeatfunc(now), map(int, repeatfunc(read_temperature)))

 while True:
     print(next(datapoints))
     time.sleep(20.0)

Documentation

API documentation for this library can be found on Read the Docs.

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adafruit-circuitpython-itertools-2.0.8.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file adafruit-circuitpython-itertools-2.0.8.tar.gz.

File metadata

File hashes

Hashes for adafruit-circuitpython-itertools-2.0.8.tar.gz
Algorithm Hash digest
SHA256 e2a769add9a9e3e5c968750fd15963dbc4cb674fa2e97646afe315d3615c78dd
MD5 d02d9c8d468352e23d76d946de89f325
BLAKE2b-256 eab342cf00c6973816cbfb428e904f4f86deac18be24cc3c41ce6fac69833c35

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_itertools-2.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_itertools-2.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3f0e549900e916763d4854629ed416a4485c0e121895dcccb0688b767944e234
MD5 2f210e46e025290297783bdf21420954
BLAKE2b-256 c44cddeb2c2eedfa48a6398bab9d5573412541cc74fedcea964db98ae8f13771

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page