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-5.0.0.tar.gz (69.1 kB view details)

Uploaded Source

Built Distribution

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

netconduit-5.0.0-py3-none-any.whl (73.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for netconduit-5.0.0.tar.gz
Algorithm Hash digest
SHA256 9722adffae46b91471ebce243f9337072f19251e6487e611a546587834620761
MD5 33ebbc8ee94a4f2cb847f38bd907d3e2
BLAKE2b-256 0ffc04e350f96375dc715b71f981979f403ad3e61798af554d60683cad179852

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for netconduit-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8752f6f80a7527ddc5387fae09995ac07cbc1b6aac57a58491a5693cdf2c8355
MD5 33dcbb43d66c90ba24a93704c58c7f49
BLAKE2b-256 0dcabdcb0d95ab1f7dcbacfcad3a904052666059ec77700a6716ea012c7d64d4

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