Skip to main content

Typing stubs for VapourSynth

Project description

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.


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

 Usage: vsstubs [OPTIONS] COMMAND [ARGS]...

 vs-stubs command line interface

╭─ Options ─────────────────────────────────────────────────────────────────────╮
│ --template  -T        Export blank template; excludes existing plugins unless │
│                       --load or --add is used.                                │
| --compat              Enable return type compatibility for APIv3 plugins.     |
│ --help                Show this message and exit.                             │
╰───────────────────────────────────────────────────────────────────────────────╯
╭─ I/O options ─────────────────────────────────────────────────────────────────╮
│ --input   -i,-I      TEXT  Path to the input .pyi file. Use '-' for piping.   │
│ --output  -o,-O      TEXT  Path to write the output .pyi file. '@' overwrites │
│                            the input file and '-' writes to stdout. With      │
│                            --wheel, this is the directory where the wheel is  │
│                            built.                                             │
│                            [default: (vapoursynth-stubs/__init__.pyi inside   │
│                            the site-package folder)]                          │
│ --wheel   -w               Build an installable vapoursynth-stubs wheel       │
│                            instead of writing a .pyi file. The wheel path is  │
│                            printed to stdout so it can be passed to pip.      │
│ --load    -L         PATH  Load plugins from a folder or a single library     │
│                            file.                                              │
╰───────────────────────────────────────────────────────────────────────────────╯
╭─ Informations ────────────────────────────────────────────────────────────────╮
│ --quiet              Suppress message output.                                 │
│ --version  -V        Show version info and exit.                              │
╰───────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────╮
│ add     Add or update the specified plugins in the stubs                      │
│ remove  Remove the specified plugins from the stubs                           │
│ check   Check for new plugins or new plugin signatures                        │
│ update  Update the current signatures from the input                          │
╰───────────────────────────────────────────────────────────────────────────────╯

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vsstubs-2.1.1.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vsstubs-2.1.1-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file vsstubs-2.1.1.tar.gz.

File metadata

  • Download URL: vsstubs-2.1.1.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vsstubs-2.1.1.tar.gz
Algorithm Hash digest
SHA256 c12c2b458b6ec2b92f4b51fd6eef6aa65fd9bf1e27bc51c6a859f4b56b8a36eb
MD5 09488a1da7680e1694432f4f262f1658
BLAKE2b-256 25511f7d0ff441488c2aa33bc98d87e590491d58e3c0f96155d2e945fc126e62

See more details on using hashes here.

Provenance

The following attestation bundles were made for vsstubs-2.1.1.tar.gz:

Publisher: pypipublish.yml on Ichunjo/vs-stubs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vsstubs-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: vsstubs-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vsstubs-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68592668250610b56bd080b81a418e0c1d460f114ff0529a775f5f88f1558656
MD5 534f7af2e931d7f5737d8195ec423cb2
BLAKE2b-256 30c2026964f8f6712f4369ce079ef2ab3b206397808d71969ae48bad306fff39

See more details on using hashes here.

Provenance

The following attestation bundles were made for vsstubs-2.1.1-py3-none-any.whl:

Publisher: pypipublish.yml on Ichunjo/vs-stubs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page