Skip to main content

A lightweight peer-to-peer networking protocol implementation in Python with bootstrap server support for peer discovery and room-based connections.

Project description

Dayanara

A minimal peer-to-peer networking protocol that lets you build distributed applications with just a few lines of code. Designed to be simple and lightweight, Dayanara handles peer discovery, room management, and message routing so you can focus on building your application. No heavy frameworks, no complex configurations—just straightforward P2P networking with minimal dependencies.

⚠️ Security Warning

This is a minimal, raw implementation designed for rapid prototyping and trusted networks.

  • No encryption - All traffic is plaintext
  • No authentication - Anyone can join any room
  • UDP-based - No guaranteed delivery
  • No NAT traversal - Requires public IPs or local network
  • Raw protocol - You must implement your own security and encryption layer

This tool provides the foundation. Security, encryption, and production-hardening are your responsibility. Recommended for: Development, local networks, VPNs, educational projects, and rapid prototyping.

Bootstrap Server

By default, Dayanara uses a hardcoded public bootstrap server - just start coding, no setup needed.

Want to run your own bootstrap? The complete server implementation is available at: bootstrap_p2p repository

Deploy it, then configure your clients:

# Custom bootstrap (optional)
d = Dayanara(bootstraps=[['your-server.com', 5000]])

API

Dayanara(bootstraps=None, debug=False)

Create a new Dayanara instance.

  • bootstraps: list of bootstrap servers (optional)
  • debug: enable debug output (default: False)

join(room: str)

Join a room and start peer discovery.

send(data)

Send data to all connected peers.

receive()

Block until a message is received and return it.

Installation

pip install dayanara

P2P chat example

import threading
import sys
from dayanara import Dayanara

room = input("room name: ")

d = Dayanara()

d.join(room)

# receive loop
def receiv_msg():
    while True:
        msg = d.receive()
        if msg:
            print(f'Incoming message: {msg}')

threading.Thread(target=receiv_msg, daemon=True).start()

# send loop
try:
    while True:
        message = input('message:')
        if message:
            d.send(message)
except KeyboardInterrupt:
    sys.exit(0)

Use Cases

  • Game lobbies
  • Chat rooms
  • IoT discovery
  • File sharing (local networks)
  • Educational P2P projects
  • Hackathon prototypes

License

MIT

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

dayanara-0.1.4.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

dayanara-0.1.4-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file dayanara-0.1.4.tar.gz.

File metadata

  • Download URL: dayanara-0.1.4.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dayanara-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3e638f8c39f1a50efcf7d21687d14b4ebf3c63692c37cf5e71fd2886be09691a
MD5 a8fcc898d728195c4e3bb62f73b97e4e
BLAKE2b-256 e414747c49213b4af990e2024cbdd5a77d30a65108caf6ff351c48928d7502ae

See more details on using hashes here.

File details

Details for the file dayanara-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: dayanara-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dayanara-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3ba40cfcf0dba330579423f52276b9247af71ce479f71e9f44591b28f30dde54
MD5 cf7f9a3ac37a3837f585d95250961e79
BLAKE2b-256 f53e5609689144def1f1e14e634132ec9b988a768b1d92673a542710426b5fd8

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