/freecad-stubs

FreeCAD stubs generated using mypy.stubgen

Primary LanguagePythonGNU Lesser General Public License v3.0LGPL-3.0

freecad-stubs project

This project use mypy.stubgen to generate stubs for FreeCAD modules

Usage

  1. Clone repo : git clone https://github.com/CyrilWaechter/freecad-stubs.git
  2. 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}

Context

This stubs generator was developed as part of a FreeCAD community effort to make development around FreeCAD easier. See :

You might also want to checkout Vanuan / freecad-python-stubs which might superseed this repository at some point.

Known issues

  • Do not generate stubs for some submodules :
    • FreeCAD.Units
  • Generated types are mainly not accurate