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

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for adafruit-circuitpython-itertools-2.0.2.tar.gz
Algorithm Hash digest
SHA256 531337f86100ffdd34f6e2cd3767bc1a08bb8e045ad818aa4e641fd0b80b8775
MD5 ba11c73e144fd1a387018b8cac03dcd9
BLAKE2b-256 c1ba8bee593b06b7b13b0c09107702647febd7397e22600c8cfe6686b6a81d63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adafruit_circuitpython_itertools-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e0fea46c4d626c258aeef8a5ecb0abdb675ad42ec1af45b80c0b35fdb5d7eb09
MD5 e4aa60b20c0fc538074e54e98f59785c
BLAKE2b-256 1ea98d43c8e272c5e8a26258c57e0e64b4e654777b9935efb02855cf9a77d789

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