AI-powered automatic generation of documentation comments for classes, modules, and packages, including translation of existing comments and lazy customization of docstrings.
Project description
xstring 🚀✨
xstring is an AI-powered tool that can automatically generate documentation comments for classes, modules, and packages. It also supports the translation and customization of existing comments. 💡📝
Features 🌟
- Automatic Generation: Automatically generate documentation comments for classes, modules, and packages by parsing the Python Abstract Syntax Tree (AST), feeding the relevant key code to AI, and using the Google Docstrings template to generate precise comments. 🛠️
- Smart Translation: Translate existing comments, supporting multiple languages. The input can be a Python package, module, or class. If it's a package, it will parse the syntax tree layer by layer, perform source code injection, and inject comments into the source code. 🌐
- Comment Polishing: Use AI technology to polish comments for improved readability. A small but powerful feature. 📖✨
- Flexible Customization: Easily customize all comments across the entire repository. This framework-level functionality has low-level API extensibility. 🔧
Installation 📦
You can easily install xstring using pip
:
pip install xstring
Quick Start 🚀
Here is a simple example demonstrating how to use xstring to automatically generate and manage documentation comments.
import pytest
from xstring.manager import SimpleManager
manager = SimpleManager(pattern='fill')
manager.traverse(lazyllm_package.components,
skip_modules=['lazyllm.components.deploy.relay.server'])
Features Overview 📚
xstring provides the following modes to easily customize all comments across the entire repository using AI and source code:
- TRANSLATE: Translate existing comments. 🌍
- POLISH: Polish and optimize comments. 💅
- CLEAR: Clear existing comments. 🗑️
- FILL: Fill in missing comments. 📝
Documentation 📖
For more detailed information and advanced usage, please refer to our .
Contributing 🌟
Contributions are welcome! Please read CONTRIBUTING.md for more information. 💖
License 📄
This project is licensed under the MIT License. For more details, please refer to LICENSE. 📝
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file xstring-0.1.5.tar.gz
.
File metadata
- Download URL: xstring-0.1.5.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/4.18.0-425.3.1.el8.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df7c7375bcba952775a982145489f1bb52b66b8051857d5b363fab042543d62 |
|
MD5 | 2ba83268655b56ee24ae22b84c0a8f37 |
|
BLAKE2b-256 | 77d4ff1ef25b020d38f3773eb45be6369861cd546c935abf0e0efcafca1a8330 |
File details
Details for the file xstring-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: xstring-0.1.5-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/4.18.0-425.3.1.el8.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b013f9294033e145f6eed449752a7eb9964b0f73339d7f4693eaaf15e46222f |
|
MD5 | f85a38c784add2e8f3fdf4fbc191732d |
|
BLAKE2b-256 | 61eb32ff8a474b9a37ea38bc449e53894e4025306bd70059abf08398b97aa88d |