LLM-based Python docstring generator 0.0.1
分类: 下载/工具 · 工具软件 | 来源: 点击进入 | 版本: 0.0.1 |
日期: 2025-06-17 | 人气: | 大小: |
标签: generator python sphinx keybindings autodocstring docblockr docstring google numpy pydocstring starlark |
LLM-based Python Docstring Generator: Enhancing Python Documentation with AI
The LLM-based Python Docstring Generator is a cutting-edge Visual Studio Code extension designed to streamline the documentation process for Python developers. By harnessing the power of AI and Natural Language Processing (NLP), this tool automatically generates comprehensive docstrings for Python functions, saving you time and ensuring consistency in your code documentation.
Key Features:
- AI-Powered Docstring Generation: Utilizes a quantized version of Mistral-AI's 7B model to produce detailed docstrings.
- Multiple Docstring Formats: Supports Google (default), docBlockr, Numpy, and Sphinx formats, catering to different documentation styles.
- Customizable Templates: Attempts to include variable types and descriptions according to the chosen template, enhancing the clarity of your documentation.
Important Note:
To use this extension, you must run an LLM instance. Detailed instructions on setting up the backend are provided in the Usage section below.
Usage:
Backend Setup:
(1) ngrok & Google Colab Solution:
- Create accounts on ngrok and Google Colab.
- Open the server notebook on Google Colab.
- Replace
<authtoken>
with your ngrok authtoken in the second cell and uncomment the line. - Run all cells.
- Copy the ngrok address (without https) into the extension settings under
llmdocstring.ServerEndpoint
.
(2) Local Setup:
- Create and activate a new Python environment (version 3.9 recommended).
- In the
server
directory, install dependencies usingpip install -r requirements.txt
. - Install
llama-cpp-python
according to your hardware specifications. - Run
python llmserver.py
. - Set
127.0.0.1:5000
as thellmdocstring.ServerEndpoint
in the extension settings.
Using the Extension in VSCode:
- Place your cursor directly below the function definition.
- Open the docstring with triple quotes (
"""
or'''
). - Press Enter to trigger auto-population of the docstring.
- Use the keyboard shortcut
Ctrl+Shift+2
(Windows) orCmd+Shift+2
(Mac), which can be customized in Preferences -> Keyboard Shortcuts ->extension.generateDocstring
. - Alternatively, use the command "Generate Docstring" or right-click and select "Generate Docstring" from the context menu.
Demo:
Experience the tool in action with this real-time demo using Google Colab T4 runtime as the backend: Demo Video.
Conclusion:
The LLM-based Python Docstring Generator revolutionizes the way Python developers document their code. By integrating AI technology into your development workflow, this VSCode extension ensures that your functions are thoroughly and accurately documented, enhancing code readability and maintainability.
-
- Golang云原生架构师课程
- Go是一门并发支持、垃圾回收的编译型系统编程语言;本课程转载自哔哩哔哩:https://www.bilibili.com/video/BV1Mh411M7A
- 204次学习
-
- MySQL数据管理之备份恢复案例解析视频教程
- 《MySQL数据管理之备份恢复案例解析视频教程》MySQL是一个开放源码的小型关联式数据库管理系统,目前MySQL被广泛地应用在Internet上的中小型网站中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型网站为了降低网站总体拥有成本而选择了MySQL作为网站数据库。
- 160次学习
-
- MySQL索引优化解决方案
- 本套课程是根据MySQL索引的设计理念与数据结构、索引使用场景、索引分类、索引运用场景、索引性能分析、查询优化、MySQL索引的慢查询等组成,主要讲述了MySQL索引优化的解决方案,非常适合有MySQL使用基础或者有一定工作经验的同学。课程讲解了解决大数量查询慢的问题、如何编写一个高效的SQL、查询语句应该如何优化、索引的实现原理是什么、索引又应该如何优化...等诸多SQL索引优化的难点和面试点。
- 182次学习
-
- 极客学院Docker视频教程
- Docker是PaaS提供商dotCloud开源的一个基于LXC的高级容器引擎,源代码托管在Github上,基于go语言并遵从Apache2.0协议开源。Docker自2013年以来非常火热,无论是从github上的代码活跃度,还是各大厂商的支持,都使Docker成为了时下最受关注的技术,甚至微软都声称在下一代WindowsServer中集成对Docker的支持。所以我们收集了《极客学院Docke
- 243次学习
-
- Golang进阶实战编程
- 本课程是在《Go语言基础视频》基础之上录制的,是Go语言基础的后半部分。包括包的管理,IO操作,Go语言最大的亮点:高并发,goroutine,channel,反射等。本视频主要为了帮助Go语言的初学者,从零到一的快速入门。学完本套课程,可以学会如果通过包管理Go项目,并发模型,以及并发实现,channel通道如何传递数据,反射等等。
- 127次学习
-
- JavaScript极速入门
- 本套课程将帮助大家迅速掌握JavaScript这门高端的、动态的、弱类型编程语言。知识点简单明了,让你学习0压力,适合新手观看学习......
- 431次学习
-
- Golangmap实践及实现原理解析
- 2022-12-28 505浏览
-
- GoLand调式动态执行代码
- 2023-01-13 502浏览
-
- 试了下Golang实现try catch的方法
- 2022-12-27 502浏览
-
- 用Nginx反向代理部署go写的网站。
- 2023-01-17 502浏览
-
- MySQL主从切换的超详细步骤
- 2023-01-01 501浏览
-
- Mysql-普通索引的 change buffer
- 2023-01-25 501浏览