Metadata-Version: 2.4
Name: aiomsg
Version: 2026.7.1
Summary: Socket-based abstraction for messaging patterns
Keywords: asyncio,socket,network,messaging
Author: Caleb Hattingh
Author-email: Caleb Hattingh <caleb.hattingh@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Communications
Classifier: Topic :: System :: Networking
Requires-Dist: sphinx ; extra == 'doc'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/cjrh/aiomsg
Provides-Extra: doc
Description-Content-Type: text/markdown

# aiomsg (Python)

Pure-Python smart sockets (like ZMQ) for simpler networking — the **reference
implementation** of the [aiomsg protocol](../PROTOCOL.md).

This is the Python member of the multi-language [aiomsg](../README.md) family.
For the full design narrative, message-distribution cookbook, and TLS guide, see
the [top-level README](../README.md). For the on-the-wire spec shared by every
language implementation, see [PROTOCOL.md](../PROTOCOL.md).

## Install

```sh
pip install aiomsg
```

## Quickstart

The end that binds (the "server"):

```python
import asyncio, time
from aiomsg import Søcket

async def main():
    async with Søcket() as sock:
        await sock.bind('127.0.0.1', 25000)
        while True:
            await sock.send(time.ctime().encode())
            await asyncio.sleep(1)

asyncio.run(main())
```

The end that connects (the "client"):

```python
import asyncio
from aiomsg import Søcket

async def main():
    async with Søcket() as sock:
        await sock.connect('127.0.0.1', 25000)
        async for msg in sock.messages():
            print(msg.decode())

asyncio.run(main())
```

Both are complete, runnable programs.

## Development

This package uses [uv](https://docs.astral.sh/uv/) and
[just](https://github.com/casey/just). From this directory:

```sh
just sync     # create the venv with test + lint deps
just test     # run the test suite
just lint     # ruff check
just fmt      # ruff format
```

Releasing is documented in [RELEASING.md](RELEASING.md).
