Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions vrpc-py/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vmp-py - Vuer Message Protocol (Python)
# vuer-rpc - Vuer Message Protocol (Python)

A lightweight, cross-language messaging and RPC protocol designed for use with Vuer and Zaku.

Expand All @@ -15,13 +15,13 @@ A lightweight, cross-language messaging and RPC protocol designed for use with V
Using uv (recommended):

```bash
uv pip install vmp-py
uv pip install vuer-rpc
```

Using pip:

```bash
pip install vmp-py
pip install vuer-rpc
```

### Optional Dependencies
Expand All @@ -30,22 +30,22 @@ Install with specific features:

```bash
# For PyTorch support
uv pip install "vmp-py[torch]"
uv pip install "vuer-rpc[torch]"

# For PIL/Pillow support
uv pip install "vmp-py[image]"
uv pip install "vuer-rpc[image]"

# For safetensors support
uv pip install "vmp-py[safetensors]"
uv pip install "vuer-rpc[safetensors]"

# For all extensions (torch, PIL, safetensors)
uv pip install "vmp-py[extensions]"
uv pip install "vuer-rpc[extensions]"

# For development (includes pytest + all extensions)
uv pip install "vmp-py[dev]"
uv pip install "vuer-rpc[dev]"

# Install everything
uv pip install "vmp-py[all]"
uv pip install "vuer-rpc[all]"
```

## Quick Start
Expand Down Expand Up @@ -114,7 +114,7 @@ print(decoded_event["data"]["data"]) # numpy array restored

## Optional Type Extensions

vmp-py uses an extensible type registry system. NumPy is supported by default, but you can enable support for additional types by importing their extensions.
vuer-rpc uses an extensible type registry system. NumPy is supported by default, but you can enable support for additional types by importing their extensions.

### Using PyTorch

Expand Down Expand Up @@ -209,7 +209,7 @@ decoded = ZData.decode(encoded)

### Extending the Registry in External Libraries

Library authors can register their types with vmp-py's global `TYPE_REGISTRY`. This allows seamless integration without requiring users to manually register types.
Library authors can register their types with vuer-rpc's global `TYPE_REGISTRY`. This allows seamless integration without requiring users to manually register types.

**Example: Creating a VMP extension library**

Expand Down Expand Up @@ -261,7 +261,7 @@ decoded = ZData.decode(encoded)
**Best practices for library authors:**

1. **Use namespaced ztype names**: `"your_library.TypeName"` prevents collisions
2. **Make VMP support optional**: Don't require vmp-py as a hard dependency
2. **Make VMP support optional**: Don't require vuer-rpc as a hard dependency
3. **Document the import**: Tell users to import your `vmp_support` module
4. **Version your ztypes**: Use `"your_library.v1.TypeName"` if your format may change
5. **Access TYPE_REGISTRY directly**: Import from `vmp_py.type_registry` for type hints
Expand Down Expand Up @@ -398,7 +398,7 @@ data = json_ser.decode(json_bytes)
```bash
# Clone the repository
git clone https://github.com/yourusername/vuer-message-protocol.git
cd vuer-message-protocol/vmp-py
cd vuer-message-protocol/vuer-rpc

# Install with all dependencies
uv sync --all-extras
Expand Down
4 changes: 2 additions & 2 deletions vrpc-py/examples/basic_usage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Basic usage examples for vmp-py.
Basic usage examples for vuer-rpc.

Demonstrates:
- ZData encoding/decoding
Expand All @@ -9,7 +9,7 @@
"""

import numpy as np
from vuer_vrpc import (
from vuer_rpc import (
ZData,
MessagePackSerializer,
set_event,
Expand Down
22 changes: 11 additions & 11 deletions vrpc-py/examples/registry_extensions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Advanced registry and extensions examples for vmp-py.
Advanced registry and extensions examples for vuer-rpc.

Demonstrates:
- Using optional type extensions (torch, PIL, safetensors)
Expand All @@ -9,7 +9,7 @@
"""

import numpy as np
from vuer_vrpc import ZData, TYPE_REGISTRY, MessagePackSerializer
from vuer_rpc import ZData, TYPE_REGISTRY, MessagePackSerializer


def example_list_types():
Expand All @@ -24,7 +24,7 @@ def example_torch_extension():

try:
# Import extension to enable torch support
from vuer_vrpc.extensions import torch_support # noqa: F401
from vuer_rpc.extensions import torch_support # noqa: F401
import torch

print("✓ PyTorch extension loaded")
Expand All @@ -44,15 +44,15 @@ def example_torch_extension():
print("✓ Round-trip successful!")

except ImportError:
print("⚠ PyTorch not installed. Install with: uv pip install 'vmp-py[torch]'")
print("⚠ PyTorch not installed. Install with: uv pip install 'vuer-rpc[torch]'")


def example_image_extension():
"""Example: Using PIL Image extension."""
print("\n=== PIL Image Extension ===")

try:
from vuer_vrpc.extensions import image_support # noqa: F401
from vuer_rpc.extensions import image_support # noqa: F401
from PIL import Image

print("✓ PIL extension loaded")
Expand All @@ -70,16 +70,16 @@ def example_image_extension():
print("✓ Round-trip successful!")

except ImportError:
print("⚠ PIL not installed. Install with: uv pip install 'vmp-py[image]'")
print("⚠ PIL not installed. Install with: uv pip install 'vuer-rpc[image]'")


def example_safetensors_extension():
"""Example: Using safetensors extension."""
print("\n=== Safetensors Extension ===")

try:
from vuer_vrpc.extensions import safetensors_support # noqa: F401
from vuer_vrpc.extensions.safetensors_support import encode_as_safetensor
from vuer_rpc.extensions import safetensors_support # noqa: F401
from vuer_rpc.extensions.safetensors_support import encode_as_safetensor

print("✓ Safetensors extension loaded")

Expand Down Expand Up @@ -109,7 +109,7 @@ def example_safetensors_extension():
print("✓ Round-trip successful!")

except ImportError:
print("⚠ Safetensors not installed. Install with: uv pip install 'vmp-py[safetensors]'")
print("⚠ Safetensors not installed. Install with: uv pip install 'vuer-rpc[safetensors]'")


def example_custom_type():
Expand Down Expand Up @@ -211,7 +211,7 @@ def example_mixed_types_serialization():

# Try to import all extensions
try:
from vuer_vrpc.extensions import torch_support, image_support # noqa: F401
from vuer_rpc.extensions import torch_support, image_support # noqa: F401
import torch
from PIL import Image

Expand Down Expand Up @@ -243,7 +243,7 @@ def example_mixed_types_serialization():

except ImportError as e:
print(f"⚠ Some extensions not available: {e}")
print(" Install with: uv pip install 'vmp-py[all]'")
print(" Install with: uv pip install 'vuer-rpc[all]'")


def main():
Expand Down
4 changes: 2 additions & 2 deletions vrpc-py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "vuer-vrpc"
name = "vuer-rpc"
version = "0.1.0"
description = "Vuer RPC (vRPC) - Python implementation for cross-language messaging and RPC"
readme = "README.md"
Expand Down Expand Up @@ -52,7 +52,7 @@ addopts = [
]

[tool.coverage.run]
source = ["vuer_vrpc"]
source = ["vuer_rpc"]
omit = ["*/tests/*"]

[tool.coverage.report]
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
PIL_AVAILABLE = False
raise ImportError(
"Pillow is not installed. Install it with: "
"uv pip install 'vmp-py[image]' or pip install Pillow"
"uv pip install 'vuer-rpc[image]' or pip install Pillow"
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
SAFETENSORS_AVAILABLE = False
raise ImportError(
"Safetensors is not installed. Install it with: "
"uv pip install 'vmp-py[safetensors]' or pip install safetensors"
"uv pip install 'vuer-rpc[safetensors]' or pip install safetensors"
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
TORCH_AVAILABLE = False
raise ImportError(
"PyTorch is not installed. Install it with: "
"uv pip install 'vmp-py[torch]' or pip install torch"
"uv pip install 'vuer-rpc[torch]' or pip install torch"
)


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion vrpc-py/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Tests for vmp-py."""
"""Tests for vuer-rpc."""
2 changes: 1 addition & 1 deletion vrpc-py/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import pytest
from vuer_vrpc import (
from vuer_rpc import (
set_event,
add_event,
update_event,
Expand Down
14 changes: 7 additions & 7 deletions vrpc-py/tests/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest
import numpy as np
from vuer_vrpc import ZData, TYPE_REGISTRY
from vuer_rpc import ZData, TYPE_REGISTRY


def test_list_registered_types():
Expand All @@ -18,7 +18,7 @@ def test_torch_extension():
"""Test torch extension can be imported and works."""
pytest.importorskip("torch")
import torch
from vuer_vrpc.extensions import torch_support # noqa: F401
from vuer_rpc.extensions import torch_support # noqa: F401

# Check type is registered
assert "torch.Tensor" in ZData.list_types()
Expand All @@ -37,7 +37,7 @@ def test_image_extension():
"""Test PIL image extension can be imported and works."""
pytest.importorskip("PIL")
from PIL import Image
from vuer_vrpc.extensions import image_support # noqa: F401
from vuer_rpc.extensions import image_support # noqa: F401

# Check type is registered
assert "image" in ZData.list_types()
Expand All @@ -55,8 +55,8 @@ def test_image_extension():
def test_safetensors_extension():
"""Test safetensors extension can be imported and works."""
pytest.importorskip("safetensors")
from vuer_vrpc.extensions import safetensors_support
from vuer_vrpc.extensions.safetensors_support import encode_as_safetensor
from vuer_rpc.extensions import safetensors_support
from vuer_rpc.extensions.safetensors_support import encode_as_safetensor

# Check type is registered
assert "safetensor.dict" in ZData.list_types()
Expand Down Expand Up @@ -111,8 +111,8 @@ def test_multiple_extensions_together():
pytest.importorskip("safetensors")

from PIL import Image
from vuer_vrpc.extensions import torch_support, image_support, safetensors_support # noqa: F401, F811
from vuer_vrpc.extensions.safetensors_support import encode_as_safetensor
from vuer_rpc.extensions import torch_support, image_support, safetensors_support # noqa: F401, F811
from vuer_rpc.extensions.safetensors_support import encode_as_safetensor

# Create mixed data
data = {
Expand Down
4 changes: 2 additions & 2 deletions vrpc-py/tests/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest
import numpy as np
from vuer_vrpc import (
from vuer_rpc import (
MessagePackSerializer,
JSONSerializer,
set_event,
Expand Down Expand Up @@ -86,7 +86,7 @@ def test_msgpack_with_torch():
"""Test MessagePack with PyTorch tensors."""
pytest.importorskip("torch")
import torch
from vuer_vrpc.extensions import torch_support # noqa: F401
from vuer_rpc.extensions import torch_support # noqa: F401

serializer = MessagePackSerializer(greedy=True)

Expand Down
2 changes: 1 addition & 1 deletion vrpc-py/tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import pytest
from vuer_vrpc import (
from vuer_rpc import (
create_client_event,
create_server_event,
create_rpc_request,
Expand Down
6 changes: 3 additions & 3 deletions vrpc-py/tests/test_zdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest
import numpy as np
from vuer_vrpc import ZData
from vuer_rpc import ZData


def test_numpy_encode_decode():
Expand Down Expand Up @@ -49,7 +49,7 @@ def test_torch_encode_decode():
"""Test encoding and decoding of PyTorch tensors."""
pytest.importorskip("torch")
import torch
from vuer_vrpc.extensions import torch_support # noqa: F401
from vuer_rpc.extensions import torch_support # noqa: F401

# Test 1D tensor
tensor = torch.tensor([1, 2, 3, 4, 5])
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_pil_image_encode_decode():
"""Test encoding and decoding of PIL images."""
pytest.importorskip("PIL")
from PIL import Image
from vuer_vrpc.extensions import image_support # noqa: F401
from vuer_rpc.extensions import image_support # noqa: F401

# Create a simple RGB image
img = Image.new('RGB', (100, 100), color='red')
Expand Down
2 changes: 1 addition & 1 deletion vrpc-py/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vrpc-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "vmp-rs"
name = "vuer-rpc"
version = "0.1.0"
edition = "2024"
authors = ["Ge Yang"]
license = "MIT"
description = "Rust implementation of the Vuer Message Protocol"
repository = "https://github.com/vuer-ai/vuer-message-protocol"
keywords = ["vmp", "vrpc", "messagepack", "rpc", "serialization"]
keywords = ["vmp", "vuer", "vuer-rpc", "vrpc", "messagepack", "rpc", "serialization"]
categories = ["encoding", "network-programming"]

[dependencies]
Expand Down
Loading