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.3 - 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.3.tar.gz (6.5 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.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ivy_ho_club3-3.0.3.tar.gz
  • Upload date:
  • Size: 6.5 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.3.tar.gz
Algorithm Hash digest
SHA256 80f6351a22bc947ab4cdcec9deea23f442ed444aace06f8b7972d39831deb40e
MD5 731535b48640935596fd2bdc6e40212b
BLAKE2b-256 9f44599e5e9738fac725fe25e789cf217d5fa122431cbb7b4085531e4b0f0fd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ivy_ho_club3-3.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ed55cd8faa61d67fd098c77475fbf2af8630ddcf48118cb0b1132c07cb64e413
MD5 6c6e54f1fa70cdfb449d76126b0336af
BLAKE2b-256 8a978c46129fd89565538dbdba2a0f1993c5aa346cc1879004692f542fdcbe49

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