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.1.1.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file adafruit_circuitpython_itertools-2.1.1.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_itertools-2.1.1.tar.gz
Algorithm Hash digest
SHA256 468d193ced50f3402d3d1f8d5ee516be1e32cae647fc2de8b266a512c66afba3
MD5 d784d5fc31053a3c9ece7aa1e7186340
BLAKE2b-256 43d805bbf01af340382bcbba346775c63fa6d98f7706e737b40031c6bb929b68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adafruit_circuitpython_itertools-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68dd45f0925d85919bbed580bc2d4990d63780aaa8b89a287d5eda399f0e9764
MD5 3dcca7afcb708b1160d63bfd37e64a97
BLAKE2b-256 5b9fd5b3cc6e751b2992256a8f79e28f76316096a75f731432d3cac23192606e

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