Skip to main content

moat-lib-micro

% start main % start synopsis

Compatibility wrappers for async code that runs run on both CPython/anyio and MicroPython/asyncio.

% end synopsis

This module provides a unified interface for asynchronous programming that works across both CPython (using anyio) and MicroPython (using asyncio). It includes wrappers for logging and timing, common async primitives like Event, Lock, Queue, or TaskGroup, async context managers, and more.

Usage

The module provides consistent imports that work on both platforms:

from moat.lib.micro import Event, Lock, Queue, TaskGroup, sleep

# Use these primitives the same way on both CPython and MicroPython

async def worker(evt):
    await evt.wait()

async def example():
    event = Event()
    async with TaskGroup() as tg:
        tg.start_soon(worker, event)
        await sleep(1)
        event.set()

% end main

License

Licensed under the MIT License.

Metadata

Release files for moat-lib-micro 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moat-lib-micro 0.3.5
File Size Uploaded
moat_lib_micro-0.3.5.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moat-lib-micro 0.3.5
File Interpreter ABI Platform
moat_lib_micro-0.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / moat_lib_micro-0.3.5.tar.gz

Download URL moat_lib_micro-0.3.5.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fe44a2a898464e8cf9cf824e4ac267c0bce779c0a6517e04c582a92c53ce80d9
BLAKE2b-256 checksum
How to use checksums
ce63da806b7bf494070d78d0be6672bb0f986ca342a18a8530598f70428cb497
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / moat_lib_micro-0.3.5-py3-none-any.whl

Download URL moat_lib_micro-0.3.5-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbd1f075f03013d8af8d56e5b5b5f0b196a097e77585e05bfff8537d8df8af20
BLAKE2b-256 checksum
How to use checksums
447e9d14e8ed521f7a4bd6cffba41bafd7d0c36316707a1b8c66164b16f01de1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.3.5 This release

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page