11"""
2- VCDiff Plugin for Ably Python SDK
2+ VCDiff Decoder for Ably Python SDK
33
4- This module provides a production-ready VCDiff decoder plugin using the vcdiff library.
4+ This module provides a production-ready VCDiff decoder using the vcdiff-decoder library.
55It implements the VCDiffDecoder interface.
66
77Usage:
8- from ably import VCDiffPlugin , AblyRealtime
8+ from ably.vcdiff import AblyVCDiffDecoder , AblyRealtime
99
10- # Create VCDiff plugin
11- plugin = VCDiffPlugin ()
10+ # Create VCDiff decoder
11+ vcdiff_decoder = AblyVCDiffDecoder ()
1212
13- # Create client with plugin
14- client = AblyRealtime(key="your-key", vcdiff_decoder=plugin )
13+ # Create client with decoder
14+ client = AblyRealtime(key="your-key", vcdiff_decoder=vcdiff_decoder )
1515
1616 # Get channel with delta enabled
17- channel = client.channels.get("test", {"delta": "vcdiff"})
17+ channel = client.channels.get("test", ChannelOptions(params= {"delta": "vcdiff"}) )
1818"""
1919
2020import logging
2525log = logging .getLogger (__name__ )
2626
2727
28- class VCDiffPlugin (VCDiffDecoder ):
28+ class AblyVCDiffDecoder (VCDiffDecoder ):
2929 """
30- Production VCDiff decoder plugin using Ably's vcdiff library.
30+ Production VCDiff decoder using Ably's vcdiff-decoder library.
3131
3232 Raises:
3333 ImportError: If vcdiff is not installed
@@ -38,10 +38,10 @@ def __init__(self):
3838 """Initialize the VCDiff plugin.
3939
4040 Raises:
41- ImportError: If vcdiff library is not available
41+ ImportError: If vcdiff-decoder library is not available
4242 """
4343 try :
44- import vcdiff
44+ import vcdiff_decoder as vcdiff
4545 self ._vcdiff = vcdiff
4646 except ImportError as e :
4747 log .error ("vcdiff library not found. Install with: pip install ably[vcdiff]" )
@@ -79,4 +79,4 @@ def decode(self, delta: bytes, base: bytes) -> bytes:
7979
8080
8181# Export for easy importing
82- __all__ = ['VCDiffPlugin ' ]
82+ __all__ = ['AblyVCDiffDecoder ' ]
0 commit comments