Skip to content

Latest commit

 

History

236 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vs-stubs

Typing stubs for VapourSynth

vs-stubs provides Python type stubs for VapourSynth plugins and core functions. This helps editors, IDEs, and static type checkers (e.g. mypy, pyright) understand VapourSynth's API.

Due to the dynamic nature of VapourSynth's plugin system, any newly installed plugins are not automatically reflected in the stubs. When adding plugins, you will need to regenerate stubs to keep the type information accurate and in sync with your environment.

Note that vs-stubs does not include or install any actual VapourSynth plugins. Only their type definitions.

Tip

A VS Code extension is also available here (which can automatically regenerate stubs for you).


Installation

pip install vsstubs

Usage

You can use vsstubs via the command line or as a Python module.

Command Line

  • Simply update the VapourSynth stubs:

    vsstubs
  • Installing from the wheel output for a proper installation:

    pip install $(vsstubs --wheel)

    --wheel builds an installable vapoursynth-stubs wheel instead of writing a .pyi file directly.

    By default, the wheel is created in a temporary directory and the wheel path is printed to stdout, which lets shells pass it straight to pip install.

    Use --output with --wheel to choose the directory where the wheel should be built:

    vsstubs --wheel --output dist

    When --wheel is enabled, --output must be a directory path. The special output values @ and - are only for direct .pyi output and cannot be used with wheel output.

  • Generate a template stubs:

    vsstubs -o out.pyi --template
  • Add plugin stubs:

    vsstubs -i out.pyi -o @ add resize2
  • Remove plugin stubs (On Powershell you will need to escape the @ character):

    vsstubs -i out.pyi -o "@" remove resize2

Python API

from vsstubs import output_stubs

# Example usage
output_stubs(None, "output.pyi", template=True)

CLI Reference

vsstubs

Add command

vsstubs add --help

Check command

vsstubs check --help

Plugins command

vsstubs plugins --help

Remove command

vsstubs remove --help

Update command

vsstubs update --help

About

Typing stubs for VapourSynth

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages