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.0.tar.gz (165.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.0-cp312-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

websocket_rs-0.7.0-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.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: websocket_rs-0.7.0.tar.gz
  • Upload date:
  • Size: 165.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.0.tar.gz
Algorithm Hash digest
SHA256 31770120c364d32ac4cedc9dd0848da09d69ce0915d293c7065ce6998b9c5687
MD5 bb81ab4e5e32848c8069db1fe3afc863
BLAKE2b-256 d0aa7316ff60978cba93daf50a27d34ad2a7595808691596cc32b6f22e8f63c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 929e1f60a76c6333047bb84ca63296d02a450acff5972b83d08296f261c0fb0f
MD5 e1a8c6b901bf6bdae094ce109b0331f3
BLAKE2b-256 828a65c2c08262beaade5f6c45b16fa6abba21beeb69a9e1adab8d361876f903

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.0-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3a54892021c8170f037c48c76834d9370b6a67eebc9eee94b4bd1e8a59a17acc
MD5 e7435371b0c3f74e4efa261748c54d14
BLAKE2b-256 fc1f7aa3fa9ef193f66757b2078f027a49dc024841cc5c495297dbba76d4ed8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.0-cp312-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 c8335a8bea87c711e2336a1ec6e4a5514d4f22e22f09883860268ef707106f2c
MD5 520076402a779cb7f57652865953ee21
BLAKE2b-256 7571b00b6519e3672d17e4c33febd2137d9c84aa8e569ca5e734b903bf1c45e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for websocket_rs-0.7.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28791e50a43324187e4c460ddeedecaf3eaaf0f3e1a7ba06baf85683f54e9996
MD5 aeea404d40497eb09f29f240c6bd6cfb
BLAKE2b-256 af746977d9f64f33e89b7a0e4b0927621d0c389e42eda96926932b46ab3a726c

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