This project use mypy.stubgen to generate stubs for FreeCAD modules
- Clone repo :
git clone https://github.com/CyrilWaechter/freecad-stubs.git
- Make sure your IDE check
/out
for stubs. eg. for vscode/code-oss you can create an.env
file at workspace root to allow your linter / auto-completer (eg. pylint / jedi)
FREECAD_LIB=/usr/lib/freecad/lib
FREECAD_STUBS=/home/<user>/git/freecad-stubs/out
PYTHONPATH=${FREECAD_STUBS}:${FREECAD_LIB}:${PYTHONPATH}
This stubs generator was developed as part of a FreeCAD community effort to make development around FreeCAD easier. See :
- Type-checked Python
- Please demonstrate using a remote text editor to substitute the Python editor in FreeCAD
You might also want to checkout Vanuan / freecad-python-stubs which might superseed this repository at some point.
- Do not generate stubs for some submodules :
- FreeCAD.Units
- Generated types are mainly not accurate