belay

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

https://github.com/brianpugh/belay

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary

Keywords

arduino esp32 firmata hardware iot micropython package-manager physical-computing raspberry-pi-pico robotics serial

Keywords from Contributors

interactive attributes mesh interpretability profiles sequences generic projection standardization optim
Last synced: 6 months ago · JSON representation ·

Repository

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

Basic Info
  • Host: GitHub
  • Owner: BrianPugh
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 1010 KB
Statistics
  • Stars: 257
  • Watchers: 7
  • Forks: 18
  • Open Issues: 6
  • Releases: 58
Topics
arduino esp32 firmata hardware iot micropython package-manager physical-computing raspberry-pi-pico robotics serial
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing Funding License Citation

README.rst

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

|Python compat| |PyPi| |GHA tests| |Codecov report| |readthedocs|


.. inclusion-marker-do-not-remove


Belay is:

* A python library that enables the rapid development of projects that interact with hardware via a MicroPython or CircuitPython compatible board.

* A command-line tool for developing standalone MicroPython projects.

* A `Poetry`_-inspired `MicroPython package manager `_.

Belay supports wired serial connections (USB) and wireless connections via WebREPL over WiFi.

`Quick Video of Belay in 22 seconds.`_

See `the documentation`_ for usage and other details.


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.

The Belay Package Manager is for people that want to use public libraries, and get them on-device in
an easy, repeatable, dependable manner.

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.

The Belay Package Manager makes it easy to cache, update, and deploy third party libraries with your project.

Installation
============

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

.. code-block:: bash

   pip install belay

The MicroPython-compatible board only needs MicroPython installed; no additional preparation is required.
If using CircuitPython, and additional modification needs to be made to ``boot.py``. See `documentation `_ for details.

Examples
========

Turning on an LED with Belay takes only 6 lines of code.
Functions decorated with the ``task`` decorator are sent to the device and interpreted by the MicroPython interpreter.
Calling the decorated function on-host sends a command to the device to execute the actual function.

.. code-block:: python

   import belay

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


   @device.task
   def set_led(state):
       print(f"Printing from device; turning LED to {state}.")
       Pin(25, Pin.OUT).value(state)


   set_led(True)

Outputs from ``print`` calls from on-device user-code are forwarded to host ``stdout``.

`For more examples, see the examples folder.`_


.. |GHA tests| image:: https://github.com/BrianPugh/belay/actions/workflows/tests.yaml/badge.svg?branch=main
   :target: https://github.com/BrianPugh/belay/actions?query=workflow%3Atests
   :alt: GHA Status
.. |Codecov report| image:: https://codecov.io/github/BrianPugh/belay/coverage.svg?branch=main
   :target: https://codecov.io/github/BrianPugh/belay?branch=main
   :alt: Coverage
.. |readthedocs| image:: https://readthedocs.org/projects/belay/badge/?version=latest
        :target: https://belay.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status
.. |Python compat| image:: https://img.shields.io/badge/>=python-3.8-blue.svg
.. |PyPi| image:: https://img.shields.io/pypi/v/belay.svg
        :target: https://pypi.python.org/pypi/belay
.. _Quick Video of Belay in 22 seconds.: https://www.youtube.com/watch?v=wq3cyjSE8ek
.. _the documentation: https://belay.readthedocs.io
.. _For more examples, see the examples folder.:  https://github.com/BrianPugh/belay/tree/main/examples
.. _Poetry: https://python-poetry.org

Owner

  • Name: Brian Pugh
  • Login: BrianPugh
  • Kind: user
  • Location: Washington D.C.

Deep Learning Scientist and blockchain enthusiast

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it using these metadata."
title: "Belay: A Python Library for Rapid Hardware Development with MicroPython and CircuitPython"
abstract: "Task and dependency management system for Python."
type: software
authors:
  - family-names: "Pugh"
    given-names: "Brian"
    orcid: 0000-0003-0561-3829
repository-code: "https://github.com/BrianPugh/belay"
url: "https://github.com/BrianPugh/belay"
keywords:
  - python
  - micropython
  - robotics
  - hardware
  - physical-computing
license: Apache-2.0

GitHub Events

Total
  • Create event: 12
  • Issues event: 9
  • Release event: 5
  • Watch event: 14
  • Delete event: 9
  • Issue comment event: 41
  • Push event: 30
  • Pull request review event: 1
  • Pull request event: 15
  • Fork event: 5
Last Year
  • Create event: 12
  • Issues event: 9
  • Release event: 5
  • Watch event: 14
  • Delete event: 9
  • Issue comment event: 41
  • Push event: 30
  • Pull request review event: 1
  • Pull request event: 15
  • Fork event: 5

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 489
  • Total Committers: 5
  • Avg Commits per committer: 97.8
  • Development Distribution Score (DDS): 0.014
Past Year
  • Commits: 23
  • Committers: 2
  • Avg Commits per committer: 11.5
  • Development Distribution Score (DDS): 0.043
Top Committers
Name Email Commits
Brian Pugh b****7@g****m 482
dependabot[bot] 4****] 2
TimAidley t****m@a****m 2
Joe Freeman j****e@f****m 2
Mikkel Roald-Arbøl g****a@s****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 33
  • Total pull requests: 125
  • Average time to close issues: 18 days
  • Average time to close pull requests: 7 days
  • Total issue authors: 10
  • Total pull request authors: 10
  • Average comments per issue: 6.39
  • Average comments per pull request: 1.5
  • Merged pull requests: 112
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 7
  • Pull requests: 23
  • Average time to close issues: about 12 hours
  • Average time to close pull requests: about 1 month
  • Issue authors: 5
  • Pull request authors: 4
  • Average comments per issue: 0.14
  • Average comments per pull request: 1.83
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • roaldarbol (14)
  • freemansoft (6)
  • raveslave (3)
  • jsiverskog (3)
  • pdietl (2)
  • 11mbs (1)
  • Teslafly (1)
  • bnorick (1)
  • emcek (1)
  • W-Michael (1)
  • adeuring (1)
Pull Request Authors
  • BrianPugh (113)
  • freemansoft (3)
  • dependabot[bot] (3)
  • jsiverskog (2)
  • Teslafly (2)
  • pdietl (2)
  • TimAidley (2)
  • theo-lightworks (1)
  • roaldarbol (1)
  • TimAidleyAtUnity (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (3) bug (2)

Packages

  • Total packages: 4
  • Total downloads:
    • pypi 1,444 last-month
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 183
  • Total maintainers: 1
proxy.golang.org: github.com/BrianPugh/belay
  • Versions: 58
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 6 months ago
proxy.golang.org: github.com/brianpugh/belay
  • Versions: 58
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 6 months ago
pypi.org: belay
  • Versions: 58
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 1,444 Last month
Rankings
Stargazers count: 4.7%
Dependent packages count: 4.8%
Average: 8.8%
Forks count: 11.4%
Dependent repos count: 11.6%
Downloads: 11.7%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: belay
  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 26.0%
Dependent repos count: 34.0%
Average: 40.7%
Dependent packages count: 51.2%
Forks count: 51.6%
Last synced: 6 months ago

Dependencies

pyproject.toml pypi
  • pyserial ^3.1
  • python ^3.8
.github/workflows/deploy.yaml actions
  • JRubics/poetry-publish v1.13 composite
  • actions/checkout v2 composite
.github/workflows/pre-commit.yaml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pre-commit/action v2.0.3 composite
  • snok/install-poetry v1 composite
.github/workflows/tests.yaml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v2 composite
  • runforesight/workflow-telemetry-action v1 composite
  • snok/install-poetry v1 composite
tools/Dockerfile docker
  • ubuntu latest build
belay/cli/new_template/pyproject.toml pypi
poetry.lock pypi
  • aiohttp 3.8.5
  • aiosignal 1.3.1
  • alabaster 0.7.13
  • annotated-types 0.5.0
  • appnope 0.1.3
  • asttokens 2.2.1
  • async-timeout 4.0.3
  • attrs 23.1.0
  • autoregistry 1.0.0
  • babel 2.12.1
  • backcall 0.2.0
  • black 23.7.0
  • certifi 2023.7.22
  • cfgv 3.4.0
  • charset-normalizer 3.2.0
  • click 8.1.6
  • colorama 0.4.6
  • coverage 7.3.0
  • decorator 5.1.1
  • distlib 0.3.7
  • docutils 0.17.1
  • exceptiongroup 1.1.2
  • executing 1.2.0
  • filelock 3.12.2
  • flaky 3.7.0
  • frozenlist 1.4.0
  • fsspec 2023.6.0
  • gitdb 4.0.10
  • gitpython 3.1.32
  • identify 2.5.26
  • idna 3.4
  • imagesize 1.4.1
  • importlib-metadata 6.8.0
  • iniconfig 2.0.0
  • ipdb 0.13.13
  • ipython 8.12.2
  • jedi 0.19.0
  • jinja2 3.1.2
  • line-profiler 3.5.1
  • markdown-it-py 3.0.0
  • markupsafe 2.1.3
  • matplotlib-inline 0.1.6
  • mdurl 0.1.2
  • multidict 6.0.4
  • mypy-extensions 1.0.0
  • nodeenv 1.8.0
  • packaging 23.1
  • parso 0.8.3
  • pathspec 0.11.2
  • pexpect 4.8.0
  • pickleshare 0.7.5
  • platformdirs 3.10.0
  • pluggy 1.2.0
  • pre-commit 2.21.0
  • prompt-toolkit 3.0.36
  • ptyprocess 0.7.0
  • pure-eval 0.2.2
  • pydantic 2.1.1
  • pydantic-core 2.4.0
  • pygments 2.16.1
  • pyserial 3.5
  • pytest 7.4.0
  • pytest-cov 3.0.0
  • pytest-mock 3.11.1
  • pytest-timeout 2.1.0
  • pytz 2023.3
  • pyyaml 6.0.1
  • questionary 2.0.0
  • requests 2.31.0
  • rich 13.5.2
  • setuptools 68.0.0
  • shellingham 1.5.0.post1
  • six 1.16.0
  • smmap 5.0.0
  • snowballstemmer 2.2.0
  • sphinx 4.5.0
  • sphinx-rtd-theme 1.2.2
  • sphinxcontrib-applehelp 1.0.4
  • sphinxcontrib-devhelp 1.0.2
  • sphinxcontrib-htmlhelp 2.0.1
  • sphinxcontrib-jquery 4.1
  • sphinxcontrib-jsmath 1.0.1
  • sphinxcontrib-qthelp 1.0.3
  • sphinxcontrib-serializinghtml 1.1.5
  • stack-data 0.6.2
  • tomli 2.0.1
  • traitlets 5.9.0
  • typer 0.9.0
  • typing-extensions 4.7.1
  • urllib3 2.0.4
  • virtualenv 20.24.3
  • wcwidth 0.2.6
  • yarl 1.9.2
  • zipp 3.16.2