Skip to content

Commit be95a16

Browse files
author
Coding Agent
committed
https://github.com/Penify-dev/PyDocSmith.git
1 parent 4755f78 commit be95a16

File tree

6 files changed

+342
-0
lines changed

6 files changed

+342
-0
lines changed

README-es.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,63 @@ docstring_text = compose(parsed_docstring, style=DocstringStyle.REST)
5959
print(docstring_text)
6060
```
6161

62+
### Análisis de docstring de Google con Notas y Ejemplos
63+
64+
Detecta el estilo de docstring de un texto dado que contiene Notas y Ejemplos:
65+
66+
```python
67+
from PyDocSmith import parse, DocstringStyle
68+
69+
docstring = """
70+
Esta función hace algo.
71+
72+
Args:
73+
param1 (str): Descripción de param1
74+
75+
Returns:
76+
str: Descripción del valor de retorno
77+
78+
Notes:
79+
Esta es una nota.
80+
81+
Examples:
82+
>>> func('hello')
83+
'hello world'
84+
"""
85+
86+
parsed = parse(docstring, style=DocstringStyle.GOOGLE)
87+
print(parsed)
88+
```
89+
90+
### Análisis de docstrings desde un objeto
91+
92+
Analiza docstrings desde objetos Python:
93+
94+
```python
95+
from PyDocSmith import parse_from_object
96+
97+
class MyClass:
98+
"""Esta es una docstring de clase."""
99+
100+
attr: str
101+
"""Esta es una docstring de atributo."""
102+
103+
parsed = parse_from_object(MyClass)
104+
print(parsed)
105+
```
106+
107+
### Composición de docstrings con indentación personalizada
108+
109+
Renderiza una docstring analizada con indentación personalizada:
110+
111+
```python
112+
from PyDocSmith import compose
113+
114+
# Asumiendo que parsed_docstring está disponible
115+
docstring_text = compose(parsed_docstring, style=DocstringStyle.GOOGLE, indent=' ')
116+
print(docstring_text)
117+
```
118+
62119
## Características avanzadas
63120

64121
- **Analizar desde objeto:** PyDocSmith puede analizar docstrings directamente desde objetos Python, incluyendo clases y módulos, incorporando docstrings de atributos en la representación estructurada.

README-fr.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,63 @@ docstring_text = compose(parsed_docstring, style=DocstringStyle.REST)
5959
print(docstring_text)
6060
```
6161

62+
### Analyse d'une docstring Google avec Notes et Examples
63+
64+
Détecte le style de docstring d'un texte donné contenant Notes et Examples :
65+
66+
```python
67+
from PyDocSmith import parse, DocstringStyle
68+
69+
docstring = """
70+
Cette fonction fait quelque chose.
71+
72+
Args:
73+
param1 (str): Description de param1
74+
75+
Returns:
76+
str: Description de la valeur de retour
77+
78+
Notes:
79+
Ceci est une note.
80+
81+
Examples:
82+
>>> func('hello')
83+
'hello world'
84+
"""
85+
86+
parsed = parse(docstring, style=DocstringStyle.GOOGLE)
87+
print(parsed)
88+
```
89+
90+
### Analyse des docstrings à partir d'un objet
91+
92+
Analyse les docstrings à partir d'objets Python :
93+
94+
```python
95+
from PyDocSmith import parse_from_object
96+
97+
class MyClass:
98+
"""Ceci est une docstring de classe."""
99+
100+
attr: str
101+
"""Ceci est une docstring d'attribut."""
102+
103+
parsed = parse_from_object(MyClass)
104+
print(parsed)
105+
```
106+
107+
### Composition des docstrings avec une indentation personnalisée
108+
109+
Rend une docstring analysée avec une indentation personnalisée :
110+
111+
```python
112+
from PyDocSmith import compose
113+
114+
# En supposant que parsed_docstring est disponible
115+
docstring_text = compose(parsed_docstring, style=DocstringStyle.GOOGLE, indent=' ')
116+
print(docstring_text)
117+
```
118+
62119
## Fonctionnalités avancées
63120

64121
- **Analyser à partir d'un objet :** PyDocSmith peut analyser les docstrings directement à partir d'objets Python, y compris les classes et les modules, en incorporant les docstrings d'attributs dans la représentation structurée.

README-hi.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,63 @@ docstring_text = compose(parsed_docstring, style=DocstringStyle.REST)
5959
print(docstring_text)
6060
```
6161

62+
### Google Docstring के साथ Notes और Examples पार्स करना
63+
64+
दिए गए टेक्स्ट की docstring शैली का पता लगाएं जिसमें Notes और Examples हैं:
65+
66+
```python
67+
from PyDocSmith import parse, DocstringStyle
68+
69+
docstring = """
70+
यह फ़ंक्शन कुछ करता है।
71+
72+
Args:
73+
param1 (str): param1 का विवरण
74+
75+
Returns:
76+
str: वापसी मूल्य का विवरण
77+
78+
Notes:
79+
यह एक नोट है।
80+
81+
Examples:
82+
>>> func('hello')
83+
'hello world'
84+
"""
85+
86+
parsed = parse(docstring, style=DocstringStyle.GOOGLE)
87+
print(parsed)
88+
```
89+
90+
### ऑब्जेक्ट से Docstrings पार्स करना
91+
92+
Python ऑब्जेक्ट से docstrings पार्स करें:
93+
94+
```python
95+
from PyDocSmith import parse_from_object
96+
97+
class MyClass:
98+
"""यह एक कक्षा docstring है।"""
99+
100+
attr: str
101+
"""यह एक विशेषता docstring है।"""
102+
103+
parsed = parse_from_object(MyClass)
104+
print(parsed)
105+
```
106+
107+
### कस्टम इंडेंटेशन के साथ Docstrings का निर्माण
108+
109+
कस्टम इंडेंटेशन के साथ एक पार्स किए गए docstring को रेंडर करें:
110+
111+
```python
112+
from PyDocSmith import compose
113+
114+
# मान लें कि parsed_docstring उपलब्ध है
115+
docstring_text = compose(parsed_docstring, style=DocstringStyle.GOOGLE, indent=' ')
116+
print(docstring_text)
117+
```
118+
62119
## उन्नत विशेषताएं
63120

64121
- **ऑब्जेक्ट से पार्स करें:** PyDocSmith Python ऑब्जेक्ट्स से सीधे docstrings को पार्स कर सकता है, जिसमें कक्षाएं और मॉड्यूल शामिल हैं, संरचित प्रतिनिधित्व में विशेषता docstrings को शामिल करते हुए।

README-ja.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,63 @@ docstring_text = compose(parsed_docstring, style=DocstringStyle.REST)
5959
print(docstring_text)
6060
```
6161

62+
### Notes と Examples を含む Google Docstring の解析
63+
64+
Notes と Examples を含む指定されたテキストの docstring スタイルを検出します:
65+
66+
```python
67+
from PyDocSmith import parse, DocstringStyle
68+
69+
docstring = """
70+
この関数は何かをします。
71+
72+
Args:
73+
param1 (str): param1 の説明
74+
75+
Returns:
76+
str: 戻り値の説明
77+
78+
Notes:
79+
これはノートです。
80+
81+
Examples:
82+
>>> func('hello')
83+
'hello world'
84+
"""
85+
86+
parsed = parse(docstring, style=DocstringStyle.GOOGLE)
87+
print(parsed)
88+
```
89+
90+
### オブジェクトからの Docstrings の解析
91+
92+
Python オブジェクトから docstrings を解析します:
93+
94+
```python
95+
from PyDocSmith import parse_from_object
96+
97+
class MyClass:
98+
"""これはクラス docstring です。"""
99+
100+
attr: str
101+
"""これは属性 docstring です。"""
102+
103+
parsed = parse_from_object(MyClass)
104+
print(parsed)
105+
```
106+
107+
### カスタムインデントを使用した Docstrings の作成
108+
109+
カスタムインデントを使用して解析された docstring をレンダリングします:
110+
111+
```python
112+
from PyDocSmith import compose
113+
114+
# parsed_docstring が利用可能であると仮定
115+
docstring_text = compose(parsed_docstring, style=DocstringStyle.GOOGLE, indent=' ')
116+
print(docstring_text)
117+
```
118+
62119
## 高度な機能
63120

64121
- **オブジェクトからの解析:** PyDocSmith は、クラスやモジュールを含む Python オブジェクトから直接 docstrings を解析し、属性 docstrings を構造化表現に組み込むことができます。

README-ru.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,63 @@ docstring_text = compose(parsed_docstring, style=DocstringStyle.REST)
5959
print(docstring_text)
6060
```
6161

62+
### Анализ Google Docstring с Notes и Examples
63+
64+
Обнаруживает стиль docstring данного текста, содержащего Notes и Examples:
65+
66+
```python
67+
from PyDocSmith import parse, DocstringStyle
68+
69+
docstring = """
70+
Эта функция делает что-то.
71+
72+
Args:
73+
param1 (str): Описание param1
74+
75+
Returns:
76+
str: Описание возвращаемого значения
77+
78+
Notes:
79+
Это заметка.
80+
81+
Examples:
82+
>>> func('hello')
83+
'hello world'
84+
"""
85+
86+
parsed = parse(docstring, style=DocstringStyle.GOOGLE)
87+
print(parsed)
88+
```
89+
90+
### Анализ docstrings из объекта
91+
92+
Анализирует docstrings из объектов Python:
93+
94+
```python
95+
from PyDocSmith import parse_from_object
96+
97+
class MyClass:
98+
"""Это docstring класса."""
99+
100+
attr: str
101+
"""Это docstring атрибута."""
102+
103+
parsed = parse_from_object(MyClass)
104+
print(parsed)
105+
```
106+
107+
### Составление docstrings с пользовательским отступом
108+
109+
Рендерит проанализированный docstring с пользовательским отступом:
110+
111+
```python
112+
from PyDocSmith import compose
113+
114+
# Предполагая, что parsed_docstring доступен
115+
docstring_text = compose(parsed_docstring, style=DocstringStyle.GOOGLE, indent=' ')
116+
print(docstring_text)
117+
```
118+
62119
## Продвинутые особенности
63120

64121
- **Анализ из объекта:** PyDocSmith может анализировать docstrings непосредственно из объектов Python, включая классы и модули, включая docstrings атрибутов в структурированное представление.

README-zh.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,63 @@ docstring_text = compose(parsed_docstring, style=DocstringStyle.REST)
5959
print(docstring_text)
6060
```
6161

62+
### 解析带有 Notes 和 Examples 的 Google Docstring
63+
64+
检测包含 Notes 和 Examples 的给定文本的 docstring 样式:
65+
66+
```python
67+
from PyDocSmith import parse, DocstringStyle
68+
69+
docstring = """
70+
这个函数做了一些事情。
71+
72+
Args:
73+
param1 (str): param1 的描述
74+
75+
Returns:
76+
str: 返回值的描述
77+
78+
Notes:
79+
这是一个注释。
80+
81+
Examples:
82+
>>> func('hello')
83+
'hello world'
84+
"""
85+
86+
parsed = parse(docstring, style=DocstringStyle.GOOGLE)
87+
print(parsed)
88+
```
89+
90+
### 从对象解析 Docstrings
91+
92+
从 Python 对象解析 docstrings:
93+
94+
```python
95+
from PyDocSmith import parse_from_object
96+
97+
class MyClass:
98+
"""这是一个类 docstring。"""
99+
100+
attr: str
101+
"""这是一个属性 docstring。"""
102+
103+
parsed = parse_from_object(MyClass)
104+
print(parsed)
105+
```
106+
107+
### 使用自定义缩进编写 Docstrings
108+
109+
使用自定义缩进渲染解析的 docstring:
110+
111+
```python
112+
from PyDocSmith import compose
113+
114+
# 假设 parsed_docstring 可用
115+
docstring_text = compose(parsed_docstring, style=DocstringStyle.GOOGLE, indent=' ')
116+
print(docstring_text)
117+
```
118+
62119
## 高级功能
63120

64121
- **从对象解析:** PyDocSmith 可以直接从 Python 对象解析 docstrings,包括类和模块,将属性 docstrings 纳入结构化表示。

0 commit comments

Comments
 (0)