Skip to main content

A simplified socket programming toolkit for Python

Project description

kn-sock

PyPI version PyPI - Downloads GitHub Stars Docs

A simplified socket programming toolkit for Python.


🚀 Features

  • TCP/UDP Messaging (sync and async)
  • JSON over sockets
  • File transfer over TCP
  • Threaded server support
  • CLI for quick socket actions
  • Decorators and utility functions

💡 Use Cases

  • Build custom TCP/UDP servers quickly
  • Transfer files between machines
  • Send structured (JSON) data across a network
  • Stream live video and audio to multiple clients (via Python or CLI)
  • Share or execute code snippets over a network
  • Create automated socket-based test environments
  • Use CLI for local or remote debugging and diagnostics

📦 Installation

pip install kn-sock

🔧 Quick Example

from kn_sock import send_tcp_message

send_tcp_message("localhost", 8080, "Hello, World!")

📚 Documentation

Full documentation is available at kn-sock Documentation.


🤝 Contributing

Have ideas or found bugs? Open an issue or submit a pull request!

If you're new:

  • See the contributing guide
  • Or just start with a ⭐ star :)

🧾 License

This project is licensed under the MIT License.


4fa Live Video/Audio Streaming (Multi-Video Selection)

You can stream one or more video files (with audio) to multiple clients. The server will offer a list of available videos, and the client can select which to play.

Start the server with multiple videos:

python examples/server_live.py video1.mp4 video2.mp4 8000 8001 8010

Start the client:

python examples/client_live.py 127.0.0.1 8000 8001 8010

If multiple videos are available, the client will be prompted to select one.

  • Adaptive Bitrate: The server adjusts video quality per client based on buffer feedback.
  • Robust Audio/Video Sync: The protocol ensures smooth playback and resynchronization.

See examples/server_live.py and examples/client_live.py for more details.

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

kn-sock-0.2.4.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

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

kn_sock-0.2.4-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file kn-sock-0.2.4.tar.gz.

File metadata

  • Download URL: kn-sock-0.2.4.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for kn-sock-0.2.4.tar.gz
Algorithm Hash digest
SHA256 179d909691cf0346be0fe2379ef0753a85d23250ca9572b1912c5338a609a2e3
MD5 5e667dfec35b442a2713f06e1950b508
BLAKE2b-256 0498330f3d109f5be0c1f654a4dd85aeea5cfa9ccda75593226e8e92a0ad70b8

See more details on using hashes here.

File details

Details for the file kn_sock-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: kn_sock-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for kn_sock-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b0b53c0a924833ba236bcf5a137de64bdc811319b973ca1bbf0a4044ecccb052
MD5 d9c5fba5822692dc66fb718cb4924c60
BLAKE2b-256 e7fc341b03531de071c04172936342377380d4af8cdb6ea32bc3a13ca033f8e2

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