Production-ready async bidirectional TCP communication library with custom binary protocol, type-safe RPC, and Pydantic integration
Project description
netconduit
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netconduit-4.0.0.tar.gz.
File metadata
- Download URL: netconduit-4.0.0.tar.gz
- Upload date:
- Size: 65.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b54cc02e0562f77b13154e08e4cd54e990c996606aa6425ac33c571e1ef35158
|
|
| MD5 |
e893f562371ab2735a6e23f186a4c446
|
|
| BLAKE2b-256 |
6cfee6b3dd4337a985090495e51ae9d617842ef295c186982bb2b3677fa2a130
|
File details
Details for the file netconduit-4.0.0-py3-none-any.whl.
File metadata
- Download URL: netconduit-4.0.0-py3-none-any.whl
- Upload date:
- Size: 68.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99ba03ec6fc682696ab33d6e073b14d95b94b02dc1e7d4c2759e6f107529420b
|
|
| MD5 |
7e8e124234b96b3b2b8f6cd03e9b24b5
|
|
| BLAKE2b-256 |
1fef72e45ae291ccf0194cf6a27241119e536f2f8101f8c9b32af6f0fb969068
|