Show HN: Fake-bpy-module – Blender/UPBGE Python autocompletion for external IDEs
fake-bpy-module provides Python API stub files for Blender and UPBGE, enabling autocompletion and type hinting in external IDEs like VSCode.
fake-bpy-module, an open-source collection of Python API stub files for Blender and UPBGE, was shared on Hacker News by its author and maintainer, nutti. The project generates .pyi stub files that enable code autocompletion and type hinting in external IDEs such as VSCode, covering Blender versions 2.78 through 5.2+.
The stubs are distributed via PyPI and can be installed with a version-specific package (e.g., pip install fake-bpy-module-5.2) or as a rolling latest build (pip install fake-bpy-module), per the project's GitHub repository. To keep the latest stubs current, a custom CI/CD pipeline builds the Blender binary daily from the latest source code. The project also includes a sub-project, fake-bge-module, which covers the UPBGE game engine's Python API (bge) and is hosted at a separate repository.
The tool addresses a specific limitation in Blender's development environment: Blender does not expose its Python API (bpy) as standard Python files outside of its built-in text editor, making add-on development in external IDEs error-prone and lacking in editor support. Rather than using Python's standard inspect module — which the HN post notes often fails in Blender's dynamic runtime environment — fake-bpy-module parses the official Blender Python API documentation directly to generate the stubs.
Documentation-based parsing introduces its own complications. Some APIs are undocumented, and others cannot be used directly as parsed (the bpy_prop_collection class is cited as one example). To handle these cases, the generator applies internal transformations and patches to types during the stub generation phase, according to the project description.
Nutti states the project has been under active maintenance for over eight years. No organizational backing, funding, or team size is mentioned in the source; the project appears to be a solo open-source effort. The author is soliciting community feedback via the Hacker News thread.
No comments yet — start the thread.