
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
A utility to generate Python API stubs from documentation files in reStructuredText format.
A utility to generate Python API stubs from documentation files in reStructuredText format.
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:
Auto-completion at work in PyCharm:
Pop-up documentation support in VSCode:
The library can be installed using pip
as follows:
$ pip install bpystubgen
If you want to generate the API stubs yourself, you can use bpystubgen
module which
can be invoked with the following options:
$ python -m bpystubgen -h
usage: bpystubgen [-h] [--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
--verbose Print debug messages
--quiet Print only error messages
If you just want to use the API stubs, you can install them from PyPI without having to generate them yourself.
There are two variants of the API stubs, one for Blender and the other for UPBGE. For Blender,
you can install blender-stubs
module with an appropriate version qualifier as follows:
$ pip install blender-stubs==3.1.*
This will install the latest module for Blender 3.1, and for now stubs are provided for Blender
2.80 and onwards. You can also specify the next unreleased version as 3.2.*
to get the latest
snapshot of the module.
As for UPBGE, stubs are available for the 0.3 release, which you can install as follows:
$ pip install upbge-stubs==0.3.0.*
And for the latest snapshot version,
$ pip install upbge-stubs==0.3.1.*
You can also install it using Pipenv
. Note that it is required to set allow_preleases
option
in case the target application has no stable release (i.e. UPBGE 0.3 branch). You can use the
following content as a template for your Pipfile
:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[packages]
"upbge-stubs" = "==0.3.1.*"
[requires]
python_version = "3.10"
[pipenv]
allow_prereleases = true
Also, it would be more correct to use [dev-packages]
instead of [packages]
, in which
case you can install or update the stubs using the -d
flag like pipenv update -d
.
This project is provided under the terms of GNU General Public License v3 (GPL3).
FAQs
A utility to generate Python API stubs from documentation files in reStructuredText format.
We found that bpystubgen demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.