Skip to main content

MariLib is a Python library for interacting with the Mari network.

Project description

MariLib 💫 👀 🐍

MariLib is a Python library to interact with a local Mari network. It connects to a Mari gateway via UART.

Example with TUI

MariLib provides a stateful class with gateway and node information, network statistics, and a rich real-time TUI:

mari-edge-2.webm

See the how it works in examples/basic.py.

Minimal example

Here is a minimal example showcasing how to use MariLib:

import time
from marilib.marilib import MarilibEdge
from marilib.serial_uart import get_default_port

def main():
    mari = MarilibEdge(lambda event, data: print(event.name, data), get_default_port())
    while True:
        for node in mari.gateway.nodes:
            mari.send_frame(dst=node.address, payload=b"A" * 3)
        statistics = [(f"{node.address:016X}", node.stats.received_rssi_dbm()) for node in mari.gateway.nodes]
        print(f"Network statistics: {statistics}")
        time.sleep(0.25)

if __name__ == "__main__":
    main()

See it in action in examples/minimal.py.

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

marilib_pkg-0.6.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marilib_pkg-0.6.0-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file marilib_pkg-0.6.0.tar.gz.

File metadata

  • Download URL: marilib_pkg-0.6.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for marilib_pkg-0.6.0.tar.gz
Algorithm Hash digest
SHA256 d68854f67b8f604e0082266d08f532bed1c4573d12186c18166ae053a00d49e6
MD5 c22efbc0d104de8c182881a0610d3c69
BLAKE2b-256 49e69954d2d144f9e9e238e1ca12bbc370639aec1a05f3a8307c91328ee37d80

See more details on using hashes here.

File details

Details for the file marilib_pkg-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: marilib_pkg-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 35.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for marilib_pkg-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cb609fb8f6527973150ae1b8ad4cbf44830a4d8f82ab1855264fa418fe03457
MD5 6e03ed90a2f49f406adb030f5747bae2
BLAKE2b-256 d68217c8a935adcb70d481e72c85483f34be46aa8373a7a5f5d3b1ff83e4b059

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page