A tool for automatically adding default values to Python type stubs.
Stub files, as specified in PEP 484 provide a way for type checkers to see the interface to a module that is not itself typed. Historically, default values for arguments were usually omitted in stub files, because they are not needed for type checking. However, stub files are also useful for IDEs, which do want to show defaults. Therefore, the typeshed project has decided to allow defaults for stubs. This tool provides a way to auto-add defaults for stubs.
Warning: The tool will import and/or install various packages. Make sure you trust the package you are trying to add defaults for. Please run it inside a virtual environment.
pip install stubdefaulter
python -m stubdefaulter
python -m stubdefaulter --stdlib-path path/to/typeshed/stdlib
python -m stubdefaulter --packages path/to/typeshed/stubs/requests path/to/typeshed/stubs/babel
requests
and babel
packages in typeshedpython -m stubdefaulter --typeshed-packages path/to/typeshed/stubs/requests path/to/typeshed/stubs/babel
Initial PyPI release.