Skip to main content

winerp

An IPC based on Websockets. Fast, Stable, and easy-to-use, for inter-communication between your processes or discord.py bots.

Key Features

  • Fast with minimum recorded response time being < 2ms
  • Lightweight, Stable and Easy to integrate.
  • No limitation on number of connected clients.

Installation

Stable:

pip install -U winerp

Main branch (can be unstable/buggy):

pip install git+https://www.github.com/BlackThunder01001/winerp

Working:

This library uses a central server for communication between multiple clients. You can connect a large number of clients for sharing data, and data can be shared between any connected client.

  1. Import the library:
import winerp
  1. Initialize winerp client:
ipc_client = winerp.Client(local_name = "my-cool-app", port=8080)
  1. Start the client:
await ipc_client.start()
# or
asyncio.create_task(ipc_client.start())
  • Registering routes:
@ipc_client.route
async def route_name(source, user_name):
    return f"Hello {user_name}"
  • Requesting data from another client:
user_name = await ipc_client.request(route="fetch_user_name", source="another-cool-bot", user_id = 123)
  • Sending information type data to other clients:
data = [1, 2, 3, 4]
await ipc_client.inform(data, destinations=["another-cool-bot"])

Example Usage:

Start the server on terminal using $ winerp --port 8080. You can also start the server using winerp.Server

Client 1 (some-random-bot):

import winerp
import discord
from discord.ext.commands import Bot
bot = Bot(command_prefix="!", intents=discord.Intents.all())

bot.ipc = winerp.Client(local_name = "some-random-bot", port=8080)

@bot.command()
async def request(ctx):
    # Fetching data from a client named "another-bot" using route "get_some_data"
    data = await bot.ipc.request("get_some_data", source = "another-bot")
    await ctx.send(data)


@bot.ipc.route()
async def get_formatted_data(source, user_id = None):
    return f"<@{user_id}>"


@bot.ipc.event
async def on_winerp_ready():
    print("Winerp Client is ready for connections")

bot.loop.create_task(bot.ipc.start())
bot.run("TOKEN")

Client 2 (another-bot)

import winerp
import discord
from discord.ext.commands import Bot
bot = Bot(command_prefix="?", intents=discord.Intents.all())

bot.ipc = winerp.Client(local_name = "another-bot", port=8080)

@bot.command()
async def format(ctx):
    # Fetching data from a client named "some-random-bot" using route "get_formatted_data"
    data = await bot.ipc.request("get_formatted_data", source = "some-random-bot", user_id = ctx.author.id)
    await ctx.send(data)


@bot.ipc.route()
async def get_some_data(source):
    return "You are very cool"


bot.loop.create_task(bot.ipc.start())
bot.run("TOKEN")

Metadata

Release files for winerp 1.5.0

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

Source distribution (sdist)

Source distribution for winerp 1.5.0
File Size Uploaded Provenance Actions
winerp-1.5.0.tar.gz 15.3 kB Without provenance Details for winerp-1.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 31.5 kB

Release files / winerp-1.5.0.tar.gz

Download URL winerp-1.5.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3534995892a3415f9739606cfe63cbc4e69e84d5c79b5fa5876229a2ba6bde83
BLAKE2b-256 checksum
How to use checksums
8c53c62ab2cbd3d865bbf804a1e53aa1fe2fcdf6614e5f71943131149c92e737
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / winerp-1.5.0-py3-none-any.whl

Download URL winerp-1.5.0-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae7840dd1a67ce1ccb60e785d28110010557ce544bd296537b12fa785faaeae0
BLAKE2b-256 checksum
How to use checksums
c9d3ff14e02acae9275b8f1be0a2943f8893450ff5f385bc9b35247dff69c471
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Security for winerp 1.5.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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