Metadata-Version: 2.1
Name: ubub
Version: 0.0.1.dev0
Summary: "A (micro)python library for pub-sub messaging for (u)asyncio apps"
Home-page: https://github.com/kumekay/ubub
Author: Sergei Silnov
Author-email: po@kumekay.com
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/kumekay/ubub/issues
Platform: UNKNOWN
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: MicroPython
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE

# ubub

![ubub](./logo.png)

A (micro)python library for pub-sub messaging for (u)asyncio apps

## Simple demo:

```python
from ubub import Ub

try:
    import uasyncio as asyncio
except ImportError:
    import asyncio

ub = Ub()

async def sender(msg="Ahoj!", delay=1):
    while True:
        ub.pub("topic", msg)
        await asyncio.sleep(delay)


async def receiver():
    while True:
        msg = await ub.sub("topic")
        print("Message:", msg)


async def main():
    # Subscribers
    asyncio.create_task(receiver())

    # Senders
    asyncio.create_task(sender())
    asyncio.create_task(sender("Ciao", 0.5))

    while True:
        await asyncio.sleep(1)


if __name__ == "__main__":
    asyncio.run(main())
```

## Contribution notes

### Design

Logo - Font [Assistant](https://fonts.google.com/specimen/Assistant) Extra Light 200

