Skip to main content

A short description of my awesome library.

Project description

Club3: The Ivy & Ho Anniversary Protocol 🥂

A serverless, decentralized, conflict-free shared space.

"Two nodes, one network, zero servers."

Club3 is a Python library created to celebrate the 3rd Anniversary of Ivy & Ho. It creates a shared, synchronized dictionary across a local network. It allows devices to discover each other instantly and stay in perfect sync without a central server—just like a strong partnership.


💖 The Philosophy

Under the hood, this project is built on a CRDT (Conflict-free Replicated Data Type) using a "Last-Write-Wins" register.

  • Resilience: If we disagree (concurrent updates), the system converges to a single truth without crashing.
  • Forgiveness: It accepts the newest update, understanding that the state of things changes over time.
  • Connection: It uses UDP Multicast, meaning it doesn't need a "manager" or a "server." It just needs the two of us on the same network.

🚀 Features

  • Serverless Sync: Uses UDP Multicast (224.1.1.1) to find peers automatically.
  • Real-Time: Changes on one laptop appear on the other instantly.
  • Modern Async API: Supports async for loops to trigger UI updates cleanly.
  • Smart Discovery: Includes "Thundering Herd" suppression—when a new device joins, only one peer volunteers to sync data, keeping the network quiet.
  • Thread-Safe: Built with threading.Lock to handle background network traffic while you interact with the data.

📦 Installation

No external dependencies required. Just standard Python 3.

pip install ivy-ho-club3

💻 Usage

1. The Simple "Hello"

Open Python on Computer A:

from ivy_ho import Club3

# Connect to the space
space = Club3()

# Write a note
space['anniversary'] = "Happy 3rd Year!"
space['dinner_plans'] = "Sushi at 7pm"

Open Python on Computer B:

from ivy_ho import Club3

space = Club3()

# It syncs automatically!
print(space['anniversary']) 
# Output: "Happy 3rd Year!"

2. The Reactive Dashboard (Async)

Use this to build a UI or a script that reacts whenever the other person types.

import asyncio
from ivy_ho import Club3

async def main():
    club = Club3()
    print(f"❤️ Connected as Node: {club._node_id}")

    # This loop pauses until Ivy or Ho changes something
    async for key, value in club.watch():
        print(f"✨ New Update: [{key}] is now -> {value}")

if __name__ == "__main__":
    try:
        asyncio.run(main())
    except KeyboardInterrupt:
        print("Disconnected.")

⚙️ Under the Hood

For the curious engineers:

UDP Multicast: We bind to 0.0.0.0 and join group 224.224.224.1. This broadcasts packets to everyone on the LAN.

Packet Structure: We use pickle to serialize data, sending up to 65,535 bytes (the max UDP packet size).

Thundering Herd Suppression: When a new node sends OP_SYNC_REQ, existing nodes wait a random 0.1-0.5s. The first to wake up broadcasts an OP_SYNC_CLAIM, silencing the others. This ensures we don't flood the network with duplicate data.


🥂 Dedication

To Ivy & Ho,

Here is to 3 years of:

Fixing bugs/issues together.

Merging our lives without conflicts.

Staying synchronized, no matter the latency.

Happy Anniversary!


v3.0.4 - Built with Python & Love.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ivy_ho_club3-3.0.4.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ivy_ho_club3-3.0.4-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file ivy_ho_club3-3.0.4.tar.gz.

File metadata

  • Download URL: ivy_ho_club3-3.0.4.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ivy_ho_club3-3.0.4.tar.gz
Algorithm Hash digest
SHA256 3c6967516dcd0eddce79344a9c845c1a8cc6c07dae3b2d09a0c5e89fc58f6202
MD5 455452ae8981d0a018fbe69115ab9f67
BLAKE2b-256 f40f59aad15049e1f1424bb6b8faa22c78e0910695d0bfbbb11dce4524f39c07

See more details on using hashes here.

File details

Details for the file ivy_ho_club3-3.0.4-py3-none-any.whl.

File metadata

  • Download URL: ivy_ho_club3-3.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ivy_ho_club3-3.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 42ca3f097c5c335e408de5f62277c18e0fa5c043bf7c2807760306a17e0b1061
MD5 1b0b3b7f22bd278a6f6d0911858482fc
BLAKE2b-256 9d7d20214e5c6c1aed1ad9ea6f8ac90c58774b7ec03fa6466bc727e9719f5281

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page