Skip to main content

High-performance WebSocket client library for Python using Rust

Project description

WebSocket-RS 🚀

High-performance WebSocket client implementation in Rust with Python bindings. Provides both sync and async APIs with significant performance improvements over pure Python implementations.

🎯 Performance Highlights

  • Sync Client: 1.85x faster than websocket-client, 6.2x faster than websockets
  • Async Client (Pipelined): 12x faster than picows, 21x faster than websockets
  • Pure Rust implementation with zero-copy optimizations
  • Thread-safe with concurrent operations support

📦 Installation

pip install websocket-rs

🚀 Quick Start

Synchronous Client

from websocket_rs.sync.client import connect

# Simple usage
with connect("ws://localhost:8765") as ws:
    ws.send("Hello, WebSocket!")
    response = ws.recv()
    print(response)

Asynchronous Client

import asyncio
from websocket_rs.async_client import connect

async def main():
    async with connect("ws://localhost:8765") as ws:
        await ws.send("Hello, Async!")
        response = await ws.recv()
        print(response)

asyncio.run(main())

📚 Full Documentation

Visit our GitHub repository for comprehensive documentation:

🌟 Key Features

  • 🚄 High Performance: Rust-powered implementation
  • 🔄 Dual APIs: Both sync and async support
  • ✅ Drop-in Replacement: Compatible with Python websockets library
  • 🔒 Thread-Safe: Safe concurrent operations
  • ⚡ Zero-Copy: Optimized memory usage
  • 🐍 Python 3.12+: Modern Python support

📝 Requirements

  • Python 3.12 or higher
  • Supported platforms: Linux, Windows, macOS (x86_64, ARM64)

🔗 Links

📄 License

MIT License - see LICENSE for details.


Made with ❤️ using Rust and PyO3

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

websocket_rs-0.7.1.tar.gz (168.3 kB view details)

Uploaded Source

Built Distributions

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

websocket_rs-0.7.1-cp312-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.7.1-cp312-abi3-manylinux_2_34_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ x86-64

websocket_rs-0.7.1-cp312-abi3-manylinux_2_34_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ ARM64

websocket_rs-0.7.1-cp312-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file websocket_rs-0.7.1.tar.gz.

File metadata

  • Download URL: websocket_rs-0.7.1.tar.gz
  • Upload date:
  • Size: 168.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for websocket_rs-0.7.1.tar.gz
Algorithm Hash digest
SHA256 749c326ae38ad17ebd6c0e9b0ea4ff86399f59ddbe762e419386adac46eb5d91
MD5 0fac83d92a1d33134b093eb09be54fcb
BLAKE2b-256 8496c0f57e2f60ee1794ecf68ac8e583d1b4944820e64b7d04dff8d4bc7bd47a

See more details on using hashes here.

File details

Details for the file websocket_rs-0.7.1-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for websocket_rs-0.7.1-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 edae69c5283a12140b752eb05653f2f3fea74f680187b05ad28d329df50c6a3a
MD5 6c46afcdb36d3f33b5a773b846b9a189
BLAKE2b-256 6f6dfcf780d6e348508aaffa94db79917afdc69e881a7e3a87ee1208b0725309

See more details on using hashes here.

File details

Details for the file websocket_rs-0.7.1-cp312-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for websocket_rs-0.7.1-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c231cd30cb2703dbf8556a454d6d7e19b19a17142cdb9b0cbdced98276b18228
MD5 2578e97cf175cb9f615d80ac53550a30
BLAKE2b-256 5560892db89439bc3f189c090afc3689ec2cd039d627fa7300002614bb8c4362

See more details on using hashes here.

File details

Details for the file websocket_rs-0.7.1-cp312-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for websocket_rs-0.7.1-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 936fb97497c998e2c452f69f97c967a178a60081da711368b891140865e3e9bd
MD5 096aacea12d869cb424eb504b3ffee7f
BLAKE2b-256 5210aca5babb9e4543367a4a9d3d723aee7cad38fc17d1aad0b7396867a277b2

See more details on using hashes here.

File details

Details for the file websocket_rs-0.7.1-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for websocket_rs-0.7.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 780b2befd9ae1e52835eeea58ce756fc8b3d633ff1abff335e1da7645aae154d
MD5 a0317528bae4ad8c1fe349625645024f
BLAKE2b-256 cf6aa65fd2ccd9dec497fabf4906ce5e2169c8c65392632c86f031b15590653f

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