/pyvts

A python library for interacting with the VTubeStudio API

Primary LanguagePythonMIT LicenseMIT

pyvts

License: MIT issue build codecov PyPI docs

A python library for interacting with the VTube Studio API.

Overview

pyvts is a python library for interacting with the VTube Studio API.

You can easily use the library to develop VTubeStudio Plugin to achieve your goals. For example, adding new tracking parameters to enable more actions on live2d avatars.

Quick Start

Installation

pip3 install pyvts 

Get Started

First import library you need,

import pyvts
import asyncio

Create an instance with default values, and do whateveer you want!

async def main():
    vts = pyvts.vts()
    await vts.connect()
    # Implement what you want to do
    await vts.close()

if __name__ == "__main__":
    asyncio.run(main())

Example of a call animation by emulating pressing HotKeys

async def main():
    vts = pyvts.vts(plugin_info=plugin_info)
    await vts.connect()
    await vts.request_authenticate_token()  # get token
    await vts.request_authenticate()  # use token
    b = await vts.request(vts.vts_request.requestHotKeyList())
    hotKeyList = [hotKey['name'] for hotKey in b['data']['availableHotkeys']]
    print(hotKeyList) # ['My Animation 1', 'My Animation 2', 'My Animation 3']
    await vts.request(vts.vts_request.requestTriggerHotKey(hotKeyList[0])) # send request to play 'My Animation 1'

if __name__ == "__main__":
    asyncio.run(main())

Demo

Demo examples/start.py is a good startpoint to make plugin for VTubeStudio.

Before you get started, make sure you've clone the library and installed all the dependcies

pip3 install -r requirements.txt 

Then, launch VTubeStudio, and run

python3 examples/start.py 

in command line. You will see a new tracking parameter "start_parameter" added to VTubeStudio and some information about it in command line ouput.