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

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for adafruit-circuitpython-itertools-2.1.0.tar.gz
Algorithm Hash digest
SHA256 ff58aa3ae7a2f2e5613f9a7f9048a96af6b1e0ab5ac19991c9455b901ea729e7
MD5 7aca1a8b262c8d57ac25d3f1c93f35c1
BLAKE2b-256 eac718d4575ec24227a0abbdf1c0a7bfec351f7408dfbe01f5fcfa3d4ad637de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adafruit_circuitpython_itertools-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cb3186bfb00996bcf85d27792e6aa6ab04b28e766ca8fbd97aef2365cfbb31f
MD5 d69f03f1301a7bb0b96957ffa11e0bff
BLAKE2b-256 a0be7c45738c484f5c5f88f9793db66b3c00a44603943a31b9e3f58fbc86378b

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