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.6.0.tar.gz (95.1 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.6.0-cp312-abi3-win_amd64.whl (553.2 kB view details)

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.6.0-cp312-abi3-manylinux_2_34_x86_64.whl (3.0 MB view details)

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

websocket_rs-0.6.0-cp312-abi3-manylinux_2_34_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ ARM64

websocket_rs-0.6.0-cp312-abi3-macosx_11_0_arm64.whl (595.2 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for websocket_rs-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b59d2dc4cf393649827725dd027da5940afaf2cac6c62c1e4b2b2a4d6cff1866
MD5 7563710be8296f72bf05bac1addba32d
BLAKE2b-256 f057f4b972cdfc5e86c81a6850cea65e8f4ad926d6298a2911c6768b35d32a7f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: websocket_rs-0.6.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 553.2 kB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for websocket_rs-0.6.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1ef95dda4b5f2fac323a30f5a36f26cb1f5ba36a9e27dbd089738b38b8aea501
MD5 8ca26b3683b5c35745ec9e01ecfe11ef
BLAKE2b-256 1c53b6564a4bb6fe096388d02480a724c7d74d89d2b9eaad1d7ad27fc6b8d8e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.6.0-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fedadc650ae41bce8ef07e5d57be818d7e2559e7c39209670a248a1406f20961
MD5 343c1c1a136a1a818279623593308c5c
BLAKE2b-256 08b14642cb1387cc306cb9a3b0e8325505897f226d0c50d5eaed748e525b6e9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.6.0-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 77bd7b58ad35ab46956c631555d7a2c6783d996b38cae9285d845b371577198e
MD5 739440ea450f44d067bbb4b3a6d8db3f
BLAKE2b-256 ee46cdaef97f62ba86b924821121aa27c4c21056b587fdaaa1f3875ad53e0a00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.6.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e7823698954037422ce28933f87dff3b4c556cd938ba2955c0a325718eef5bc
MD5 24405fd752c7d2866e2be01d69048b91
BLAKE2b-256 3672c9b9ba6574d635133579b8b1149093173e8bef3a560ed0b38d3427930274

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