Examples

This section contains code examples demonstrating various features of vtpy.

Basic Examples

Basic Usage

The basic usage example demonstrates:

  • Connecting to VTube Studio

  • Authenticating

  • Retrieving statistics

  • Error handling

See Basic Usage Example for the complete example.

Events Usage

The events usage example demonstrates:

  • Registering event handlers

  • Subscribing to events

  • Handling model movement events

See Events Usage Example for the complete example.

Running Examples

To run the examples:

  1. Make sure VTube Studio is running with the WebSocket API enabled

  2. Install the package (see Getting Started)

  3. Run any example:

python examples/basic_usage.py
python examples/events_usage.py

Additional Examples

For more examples, check the examples/ directory in the repository:

  • basic_usage.py - Basic connection and statistics

  • events_usage.py - Event handling