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

Built Distribution

File details

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

File metadata

File hashes

Hashes for adafruit-circuitpython-itertools-2.0.7.tar.gz
Algorithm Hash digest
SHA256 4219e9fc9aba8c7facbf23d4de1551e12c1d37e900444d4fcff4bc45156ff0e1
MD5 e59b0551e8a65cb4d06704771fdedd08
BLAKE2b-256 bf7db0a52750d9618b96343277a62f474f0101bf20e7008341898521b66a9087

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adafruit_circuitpython_itertools-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 6940428f4d5e572c7c04a8a436eddffbf4c1f14c514aeb2c03e0f88771f81c91
MD5 af17be2c6adcfae8442159f207e9c2da
BLAKE2b-256 309140f6e3e1edc5279700381bbbeeb1473bf40ca95c6474031f2cda1db0de49

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