Skip to main content

localpub 🥃

A decentralized, brokerless pub/sub for multi-process communication on a single machine.

A local pub for your processes to hang out. 🍻

CI License: MIT Ruff

Features

  • Multiple backends: Choose the right transport for your workload:
    • Unix Domain Socket Mesh — peer-to-peer, no single point of failure
    • Unix Domain Socket Broker — competitive binding, first process becomes broker
    • mmap Ring Buffer — ultra-low-latency shared memory
  • Async-first: Modern asyncio APIs with convenient sync wrappers
  • Pluggable serialization: Pass any Python object; swap in JSON, msgpack, or your own
  • Zero external dependencies: Pure stdlib for the core package
  • Fully typed: PEP 561 compatible with strict type coverage

Quick Start

import asyncio
from localpub import UnixMeshBus

async def main():
    bus = UnixMeshBus("/tmp/mypub")
    await bus.open()

    await bus.subscribe("greetings", lambda env: print(f"Received: {env.payload}"))
    await bus.publish("greetings", {"msg": "hello from process A"})

    await asyncio.sleep(1)
    await bus.close()

asyncio.run(main())

Synchronous API

from localpub import UnixMeshBus, SyncBus

bus = SyncBus(UnixMeshBus("/tmp/mypub"))
with bus:
    bus.subscribe("greetings", lambda env: print(f"Received: {env.payload}"))
    bus.publish("greetings", "hello")

Pick a backend

Backend Latency Throughput Brokerless Use case
UnixMeshBus Low Medium Yes Resilient, no single point of failure
UnixBrokerBus Low High No (elected) General purpose, simple topology
MmapRingBus Ultra-low Very High Yes High-throughput same-machine IPC

Installation

pip install localpub

Development

# Install dependencies
make install

# Run tests
make test

# Lint & format
make lint
make format

# Type check
make typecheck

# Run all checks (lint + typecheck + test)
make check

# Build wheel and sdist
make build

License

MIT — see LICENSE.

Metadata

Release files for localpub 0.1.1

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

Source distribution (sdist)

Source distribution for localpub 0.1.1
File Size Uploaded Provenance Actions
localpub-0.1.1.tar.gz 21.1 kB Without provenance Details for localpub-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for localpub 0.1.1
File Interpreter ABI Platform Actions
localpub-0.1.1-py3-none-any.whl Python 3 none any Details for localpub-0.1.1-py3-none-any.whl

Total release size: 36.1 kB

Release files / localpub-0.1.1.tar.gz

Download URL localpub-0.1.1.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bec9ffdba28f31894cd3143b29265577632dd18a9e231ed1be793dd3d51c5006
BLAKE2b-256 checksum
How to use checksums
e7cbf060568eec461f7cab876d69cbf4c22d2c519c9bf0832e99339a64fc66c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / localpub-0.1.1-py3-none-any.whl

Download URL localpub-0.1.1-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7596f9b585bcfa06e7221f24cc4efc7ce80826eee49032da14e17cd7e2486c9e
BLAKE2b-256 checksum
How to use checksums
d014a6c55f3b377ebf17b5e2b5a11fba16853a0eefc7d7fe5560b10b933d7ac9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for localpub 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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