Skip to main content

A utility to generate Python API stubs from documentation files in reStructuredText format.

Project description

pytest PyPI version

BPY Stub Generator

A utility to generate Python API stubs from documentation files in reStructuredText format.

Introduction

The main usage of the program is to create Python API stubs from the documentation generated during the build process of Blender or UPBGE so that an IDE can provide autocompletion support and type hints for relevant modules like bpy or bge.

There are already a number of tools created with a similar goal in mind, notably fake-bpy-module which can be a good alternative to this project.

However, bpystubgen has a few advantages over the others:

  • It's very fast - Some of those tools may take over an hour to generate the entire stubs for Blender. But bpystubgen can do it under a minute (1,593 source documents).
  • The generated stub modules preserve most of the source documentation, so you can use them as a manual as well.
  • It generates PEP-561 compliant stub modules, so it's safe to include them in your runtime module path.
  • Along with its fast execution speed, the project also provides well-organised API and test suites to make it easier to fix bugs or improve the output quality.

Installation

The library can be installed using pip as follows:

$ pip install bpystubgen

Usage

$ python -m bpystubgen -h

usage: bpystubgen [-h] [--format] [--verbose] [--quiet] input output

Generate Python API stubs from Blender documentation.

positional arguments:
  input       Source directory where *.rst files are located
  output      Output directory where generated modules will be saved

optional arguments:
  -h, --help  show this help message and exit
  --format    Format generated source files
  --verbose   Print debug messages
  --quiet     Print only error messages

License

This project is provided under the terms of GNU General Public License v3 (GPL3).

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

bpystubgen-0.1.3.tar.gz (27.0 kB view hashes)

Uploaded Source

Built Distribution

bpystubgen-0.1.3-py3-none-any.whl (27.9 kB view hashes)

Uploaded Python 3

Supported by

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