Skip to main content

ChordNet

GitHub Actions Workflow Status GitHub Actions Workflow Status

GitHub License PyPI - Types PyPI - Version PyPI - Downloads PyPI - Python Version PyPI - Implementation

Python implementation of the chord protocol, introduced by Stoica et al. This library began as a group project for cs536 at Purdue University in Fall 2024.

Installation

pip install chordnet

uv add chordnet

Usage

To stay consistent with the language from the original paper, we recommend naming your chordnet attribute ring:

from chordnet import ChordNet

ring = new ChordNet(...)
ring.create() # or ring.join(...)
#...application logic...
ring.leave()
# end program

This fits with the concept of "joining" an existing ring network, or creating a new one. Examples follow this practice.

At present, this package only supports IP lookup. All application-dependent logic (state transfer, etc) must be handled by the application. The easiest way to do this is to initialize ChordNet as an attribute on an application class:

class App:
    """An example/template application that uses ChordNet."""
    def __init__(self, ip: str, chordnet_port: int) -> None:
        """Creates a new insance of the app."""
        self._ring = ChordNet(ip, chordnet_port)

    def start(
        self, ip = None: str | None, port = None: int | None
    ) -> None:
        """Starts the app by joining an existing ring or creating a new one."""
        if ip and port:
            self._ring.join(ip, port)
            # ...any state transfer logic, if part of this app...
        elif not ip and not port:
            self._ring.create()
        else:
            print("need both or neither")
            return

    #...application logic (probably using self._ring.lookup()...

    def stop(self) -> None:
        """Gracefully leaves the ring."""
        # ...any state transfer logic (if using)...
        self._ring.leave()

Not all distributed applications that ChordNet is suitable for will require state transfer logic (for example, search problems), and the nature of that logic will likely vary by app. In future versions, we hope to support in-library state transfer.

Metadata

Release files for chordnet 2.2.2

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

Source distribution (sdist)

Source distribution for chordnet 2.2.2
File Size Uploaded
chordnet-2.2.2.tar.gz 11.4 kB Details

Built distribution (wheel)

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

Total release size: 24.7 kB

Release files / chordnet-2.2.2.tar.gz

Download URL chordnet-2.2.2.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3167741fd159cbe11ad629331c71aa2e047f9caacb190466c7fae9a0337d4d94
BLAKE2b-256 checksum
How to use checksums
83ab5c2d0ee175b5c68901901af20de917ece3db470ba6916205acfa2cd28170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2025.

Transparency log

Release files / chordnet-2.2.2-py3-none-any.whl

Download URL chordnet-2.2.2-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c456b4e97538ccd49fa1ca54bce15840c641e2f3a92c9f0a97509fad3dd7b8f8
BLAKE2b-256 checksum
How to use checksums
24bf17c3f016dea8ed41274a7cbbd0d0303c9897ebf450e9c88dbe551e2ff2cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.2 This release

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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