Modern Python networking library with comprehensive protocol support and developer-friendly APIs
Project description
kn-sock
A simplified socket programming toolkit for Python that makes network communication easy and efficient.
Features
- TCP/UDP Messaging: Supports both synchronous and asynchronous communication
- Secure Communication: SSL/TLS support for encrypted connections
- JSON Socket Communication: Easily send and receive JSON data over sockets
- File Transfer: Transfer files between clients and servers with progress tracking
- Live Streaming: Multi-video streaming with adaptive bitrate
- Video Chat: Real-time multi-client video chat with voice
- WebSocket Support: Full WebSocket server and client implementation
- HTTP/HTTPS: Simple HTTP client and server helpers
- Pub/Sub & RPC: Publish/subscribe messaging and remote procedure calls
- Message Queuing: Advanced queue management for reliable message delivery
- Load Balancing: Distribute connections across multiple servers
- Data Compression: Built-in compression for bandwidth optimization
- Protocol Buffers: Support for efficient binary serialization
- Decorators & Utilities: Helper decorators and utility functions
- Docker Support: Ready-to-use Docker containers and compose files
- Interactive CLI: Real-time interactive command-line interface
- Command-Line Interface: Simple CLI for quick socket operations
- Connection Pooling: Efficient connection reuse for high-performance applications
- Network Visibility: ARP scanning, MAC lookup, and DNS monitoring tools
Installation
pip install kn-sock
Quick Start
Here's a simple example to get you started:
# Server
from kn_sock import start_tcp_server
def handle_message(data, addr, client_socket):
print(f"Received from {addr}: {data.decode('utf-8')}")
client_socket.sendall(b"Message received!")
start_tcp_server(8080, handle_message)
# Client
from kn_sock import send_tcp_message
send_tcp_message("localhost", 8080, "Hello, World!")
Docker Quick Start
# Run with Docker Compose
docker-compose run knsock --help
# Run tests
docker-compose run test
For detailed Docker usage, see the Docker guide.
What's Next?
- Getting Started - Learn the basics and set up your first project
- Docker Setup - Get started with Docker containers and deployment
Protocol Documentation
- TCP Protocol - Reliable connection-based communication
- UDP Protocol - Fast connectionless messaging
- WebSocket Protocol - Real-time bidirectional communication
- JSON Communication - Structured data exchange
- File Transfer - Efficient file sharing
- Secure TCP (SSL/TLS) - Encrypted communication
Advanced Features
- Pub/Sub Messaging - Event-driven messaging patterns
- Remote Procedure Calls - Call remote functions seamlessly
- Live Streaming - Multi-video streaming with adaptive bitrate
- Video Chat - Real-time video conferencing
- HTTP/HTTPS - Web server and client functionality
Reference & Examples
- API Reference - Complete function and class documentation
- CLI Guide - Command-line interface usage
- Examples - Real-world usage examples
- Troubleshooting - Common issues and solutions
Network Visibility Tools
⚠️ ETHICAL WARNING: These tools are intended for use in authorized networks such as schools, labs, or controlled IT environments. Monitoring user traffic may be illegal without explicit consent. Use responsibly and ethically.
Network Monitoring
- ARP Scanning - Discover active devices on your network
- MAC Address Lookup - Identify device vendors by MAC address
- DNS Monitoring - Monitor and analyze DNS requests
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 kn_sock-0.3.0.tar.gz.
File metadata
- Download URL: kn_sock-0.3.0.tar.gz
- Upload date:
- Size: 61.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6369521fd514dd59515b2fcc1c19e7dd28f277033c9dbc0ffa2a405e7c5691f9
|
|
| MD5 |
2399acae78463e58ce85181356ae146c
|
|
| BLAKE2b-256 |
7708aefbdf4f461da8ca88600c968a49b89779acc58b9f112dcda8c6e4dc80df
|
File details
Details for the file kn_sock-0.3.0-py3-none-any.whl.
File metadata
- Download URL: kn_sock-0.3.0-py3-none-any.whl
- Upload date:
- Size: 53.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f10406fe06dc8090c9ac46bbb8a9865b56e72ce4b9d9e8c96b6118092f60b72
|
|
| MD5 |
61352b9504631d57bf2aec02f0d8b5d5
|
|
| BLAKE2b-256 |
eaa85d03a71563a77c574ec49b0cc8ef7cc201e7443f7e0e2ea362e38b483a25
|