Skip to main content

Production-ready async bidirectional TCP communication library with custom binary protocol, type-safe RPC, and Pydantic integration

Project description

netconduit

Python 3.10+ License: MIT

Production-ready async bidirectional TCP communication library with custom binary protocol, type-safe RPC, and Pydantic integration.

Developed by Kaede Dev - Kento Hinode

Features

  • 🚀 Async/Await - Built on asyncio
  • 🔌 Raw TCP - IPv4 & IPv6 support
  • 📦 Binary Protocol - 32-byte header + MessagePack
  • 🔐 Password Auth - SHA256-based authentication
  • 📡 Type-Safe RPC - Pydantic validation
  • 💓 Heartbeat - Automatic health monitoring
  • 🔄 Auto-Reconnect - Exponential backoff

Installation

pip install netconduit

Quick Start

Server

import asyncio
from conduit import Server, ServerDescriptor

server = Server(ServerDescriptor(
    host="0.0.0.0", port=8080, password="secret"
))

@server.rpc
async def add(a: int, b: int) -> int:
    return a + b

@server.on("chat")
async def handle_chat(client, data):
    await server.broadcast("chat", data, exclude={client.id})

asyncio.run(server.run())

Client

import asyncio
from conduit import Client, ClientDescriptor, data

client = Client(ClientDescriptor(
    server_host="localhost", server_port=8080, password="secret"
))

@client.on("chat")
async def on_chat(msg):
    print(f"Chat: {msg}")

async def main():
    await client.connect()
    result = await client.rpc.call("add", args=data(a=10, b=20))
    print(f"Result: {result}")  # {'success': True, 'data': 30}

asyncio.run(main())

Documentation

Requirements

  • Python 3.10+
  • pydantic >= 2.0
  • msgpack >= 1.0

License

MIT License - Kaede Dev - Kento Hinode

GitHub: DarsheeeGamer/NetConduit

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

netconduit-3.0.0.tar.gz (63.2 kB view details)

Uploaded Source

Built Distribution

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

netconduit-3.0.0-py3-none-any.whl (65.6 kB view details)

Uploaded Python 3

File details

Details for the file netconduit-3.0.0.tar.gz.

File metadata

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

File hashes

Hashes for netconduit-3.0.0.tar.gz
Algorithm Hash digest
SHA256 6ad06241827dece579093ef6385be4fd0348886f978041f0b56929f9359c6657
MD5 9b8435dbfbb526a19d17de1c7996c7ed
BLAKE2b-256 0f3dee470929bc69598090997ef8d6647ebaf969db0796a12c5e50cf9f25004a

See more details on using hashes here.

File details

Details for the file netconduit-3.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for netconduit-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec075f1b7475b80b3a0c22a4bde4d062bc4792ce4ac8e238ecd8179d63e4d481
MD5 99267b74803fdf4b3c7be79899438240
BLAKE2b-256 d5c3395fd3abb57264b4a48ff513906eb5ea373aad6db81ffb3e2afa2da735e2

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