A utility to generate Python API stubs from documentation files in reStructuredText format.
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bpystubgen-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24f526f049e590225cac372d39d187f0781cdc979b76640c3e605e9740643845 |
|
MD5 | 80e31ecb4cea9cf3fd4bac7ac05e017a |
|
BLAKE2b-256 | 7dcea621535d74206f43d1a18666a786bc7b32cf3dd147b2674071a8fcf902e8 |