Utility code for the rest of MoaT
Project description
This is a Python “util” submodule with code that I habitually use in so many projects that I decided to split it off into its own git archive.
Feel free to extend and embrace. Patches welcome.
Features
A few. Read the code and the subpackages’ documentation; I didn’t get around to documenting all of that yet.
License
No restrictions. CC0 / public domain / MIT / GPLv3 / whatever, as long as you don’t want anybody (i.e. the author(s)) to pay for the effects of any bugs, features or “features” which this code might or might not have.
Please contribute any enhancements.
Dependencies
A few. Notable:
anyio, version 3. Required for ValueEvent, spawn (obviously) and as_service.
ruyaml. This is a fork of ruamel.yaml which is a fork of pyyaml. Fixes some bugs and has a more reasonable API. Required for yload/yprint/yformat.
asyncclick, required for main_/wrap_main.
Optionally: msgpack.
MoaT does not depend on:
cbor2. Our implementation is shared with a version running on MicroPython and thus needs to be minimal. Also, we want to support efficient async streaming.
Paths
MoaT uses Path objects as hierarchical object accessors.
A Path is a list of text strings and/or integers that identify an object or subroutine. For instance, moat.micro may connect to an external node named “ext” with three binary outputs, so you’d call "ext" -> 1 -> "set" (True) to turn the second port on.
Since that’s somewhat awkward, MoaT paths are typically entered and displayed as single strings with dots as separators, ext:1.set in this case. There’s also a secondary representation that uses slashes (ext/:1/set) for interfacing with the file system or MQTT.
See pydoc moat.util.path.Path for details.
Project details
Release history Release notifications | RSS feed
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 moat_util-0.57.10.tar.gz
.
File metadata
- Download URL: moat_util-0.57.10.tar.gz
- Upload date:
- Size: 58.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
083db1e9bd283bfdc7fdcbeabfb5d332457cb41fade1a5759a73bcc951ae8de3
|
|
MD5 |
185c562cc4ff54d79477ca94907e3947
|
|
BLAKE2b-256 |
724a52ecbdc87773300c67e57488732636f67ef27f7d1c844360877611d8af45
|
File details
Details for the file moat_util-0.57.10-py3-none-any.whl
.
File metadata
- Download URL: moat_util-0.57.10-py3-none-any.whl
- Upload date:
- Size: 64.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d74e4b9708e082905b625725b3b377f4b2cdfb2b803685cf4a09998c77d3a604
|
|
MD5 |
6cf65392a7e9d7e70b919fd227dd69db
|
|
BLAKE2b-256 |
2540e0f9b631abc403576676f2fd4d614032d427a8b60c2b93934332b5d744bb
|