docify is a script to add docstrings to Python type stubs using reflection.
Features:
- Uses LibCST to parse and modify the stub file
- Dynamically imports the actual module to get the runtime docstring
- Handles most sys.version and sys.platform conditional blocks, will only add
docstrings to the correct branch
- Able to modify files in-place with -i or --in-place
- Won't overwrite existing docstrings
- With -b or --builtins-only, will only add docstrings for modules found in
sys.builtin_module_names (stdlib modules written in C).
- With --if-needed, will only add docstrings if the object's (Python) source
code is unavailable. Useful for language servers like basedpyright that are
able to extract docstrings from source code.
NOTE: If this package has multiple flavors (see below), then use one of them instead of the name specified above. NOTE: This is a Python port. Instead of py312-docify listed in the above command, you can pick from the names under the Packages section.
To download the package and its dependencies for another FreeBSD version or architecture, without installing it:
Change 15 to the FreeBSD major version you want; the rest keeps your current architecture. The files are saved under ./All/. Copy them to the other machine and install them there with pkg add. Ignore any warning that suggests pkg bootstrap -f. The quarterly or latest branch comes from your own repository configuration, not from this page.
textproc/py-docify: Add py-docify 1.2.1
docify is a script to add docstrings to Python type stubs using reflection.
Features:
- Uses LibCST to parse and modify the stub file
- Dynamically imports the actual module to get the runtime docstring
- Handles most sys.version and sys.platform conditional blocks, will only add
docstrings to the correct branch
- Able to modify files in-place with -i or --in-place
- Won't overwrite existing docstrings
- With -b or --builtins-only, will only add docstrings for modules found in
sys.builtin_module_names (stdlib modules written in C).
- With --if-needed, will only add docstrings if the object's (Python) source
code is unavailable. Useful for language servers like basedpyright that are
able to extract docstrings from source code.