Skip to main content

No project description provided

Project description

https://media.githubusercontent.com/media/BrianPugh/belay/main/assets/logo_white_400w.png

Python compat PyPi GHA Status Coverage Documentation Status

Belay

Belay is a library that enables the rapid development of projects that interact with hardware via a micropython-compatible board.

Quick Video of Belay in 22 seconds.

Who is Belay For?

Belay is for people creating a software project that needs to interact with hardware. Examples include:

  • Control a motor so a webcam is always pointing at a person.

  • Turn on an LED when you receive a notification.

  • Read a potentiometer to control system volume.

What Problems Does Belay Solve?

Typically, having a python script interact with hardware involves 3 major challenges:

  1. On-device firmware (usually C or MicroPython) for directly handling hardware interactions. Typically this is developed, compiled, and uploaded as a (nearly) independent project.

  2. A program on your computer that performs the tasks specified and interacts with the device.

  3. Computer-to-device communication protocol. How are commands and results transferred? How does the device execute those commands?

This is lot of work if you just want your computer to do something simple like turn on an LED. Belay simplifies all of this by merging steps 1 and 2 into the same codebase, and manages step 3 for you. Code is automatically synced at the beginning of script execution.

Installation

Belay requires Python >=3.8 and can be installed via:

pip install belay

The micropython-compatible board only needs micropython installed; no additional preparation is required.

Examples

Turning on an LED with Belay takes only 6 lines of code.

import belay

device = belay.Device("/dev/ttyUSB0")


@device.task
def set_led(state):
    Pin(25, Pin.OUT).value(state)


set_led(True)

For more examples, see the examples folder.

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

belay-0.1.0.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

belay-0.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file belay-0.1.0.tar.gz.

File metadata

  • Download URL: belay-0.1.0.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3 CPython/3.10.2 Linux/5.15.0-1014-azure

File hashes

Hashes for belay-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3a879c51157d4dc9a435ddd0ae19826b23e1b90409fbfd209b0861abbe29ff41
MD5 d221e9ac8ef2ec3c7f4dd4ff25e5fee5
BLAKE2b-256 75c9afd75c0af5faaca290984d2751e0f50728521f4196bd64acc64aa088b467

See more details on using hashes here.

File details

Details for the file belay-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: belay-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b3 CPython/3.10.2 Linux/5.15.0-1014-azure

File hashes

Hashes for belay-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e0cc5df24d77bc30a763b91ab91ec133d6ec6bc555349a50d6d77e35405d13e
MD5 fe75b0eb3572c53af3839022024432fb
BLAKE2b-256 2de92524f31ddb3c503c11f8fb1831529b133b3aa4fae0bed3dbf24cb43d010e

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