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

Uploaded Source

Built Distribution

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

netconduit-2.0.0-py3-none-any.whl (57.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for netconduit-2.0.0.tar.gz
Algorithm Hash digest
SHA256 1d2e957ca678c5eff8dbe949ddb6e6364b27c865a327bf4ae8a9a0032195a49e
MD5 7e348013ffedf9351003c58e7c1fe7ce
BLAKE2b-256 c4551ef7b56f645ba533e5b198c1724151bac761c38d17d16186b0d3fc313f53

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for netconduit-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 613e07cc2f97ab6f2890aeae82a7f720eb066a35ef71717202e8466590455188
MD5 856b4fc2af1e6fd79c8500cbc65eccdd
BLAKE2b-256 26766b710a98c78c00335631c25fab1cc73aa7e8f4970e51009e573a8adb4051

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