Skip to main content

Peer-to-peer communication library over Yggdrasil

Project description

YggPeer

YggPeer is a Python library for peer-to-peer communication over the Yggdrasil network, providing easy-to-use tools for status management, messaging, and chat between peers.

Features

  • Integration with Yggdrasil
  • Peer-to-peer messaging
  • Status management (available, busy, etc.)

Installation

Install YggPeer using pip:

pip install yggpeer

Example

# example_chat.py
from yggpeer import PeerManager
import time

def example_chat():
    peer_manager = PeerManager(local_port=12345, discovery_port=10799)

    # Add a peer (Yggdrasil IP and chat port)
    peer_manager.add_peer("Yggdrasil_IP_of_Peer", 12345)

    # Start the PeerManager services
    peer_manager.start()

    # Start sending messages to the peer
    time.sleep(2)  # Wait for the services to initialize

    while True:
        message = input("You: ")
        if message.lower() == 'quit':
            print("Exiting chat...")
            break
        peer_manager.send_message("Yggdrasil_IP_of_Peer", message)

if __name__ == "__main__":
    example_chat()

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

yggpeer-0.1.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

yggpeer-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file yggpeer-0.1.1.tar.gz.

File metadata

  • Download URL: yggpeer-0.1.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for yggpeer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6a9affccda0fe2cd36f4f8676bd7689e94fe0be5813fece8cf04667376bb8315
MD5 e96b5ed8106fba4c219a7acc81cf0cbb
BLAKE2b-256 11951e69392f58bed99866ec8d3d12f8d23c31b78d73f332945a724c4b11437f

See more details on using hashes here.

File details

Details for the file yggpeer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yggpeer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for yggpeer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 757128f91d93b6cd635f27bfc61425eef685e2d48d654cbb0ead54448a20137d
MD5 d14a2762025de7051e94daf151db6ab0
BLAKE2b-256 b7fea2d89bf70a6a7884f05289238501e8e11c3247402d30f60e255e8425c62b

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