Updated Library use in README
Browse filesUpdate the example code according to latest [v0.2.0](https://github.com/PipableAI/pip-library-parser/releases/tag/v0.2.0)
README.md
CHANGED
@@ -53,26 +53,35 @@ The model is open source under apache 2.0. License
|
|
53 |
!pip3 install atlassian-python-api
|
54 |
|
55 |
|
|
|
|
|
|
|
56 |
import torch
|
57 |
-
|
58 |
-
from atlassian.jira import Jira
|
59 |
|
|
|
|
|
60 |
|
61 |
-
|
|
|
|
|
62 |
|
63 |
-
docs = generate_module_docs(
|
64 |
print(docs)
|
65 |
```
|
66 |
|
67 |
```python
|
68 |
-
from pip_library_parser import
|
|
|
|
|
|
|
69 |
|
70 |
code_snippet = """
|
71 |
def example_function(x):
|
72 |
return x * 2
|
73 |
"""
|
74 |
|
75 |
-
docstring = generate_docstring_from_pip_model(code_snippet)
|
76 |
print("Generated Docstring:")
|
77 |
print(docstring)
|
78 |
```
|
|
|
53 |
!pip3 install atlassian-python-api
|
54 |
|
55 |
|
56 |
+
from pip_library_parser import CodeToDocGenerator
|
57 |
+
from atlassian import Jira
|
58 |
+
|
59 |
import torch
|
60 |
+
torch.set_default_device("cuda")
|
|
|
61 |
|
62 |
+
# Instantiate the CodeToDocGenerator
|
63 |
+
generator = CodeToDocGenerator()
|
64 |
|
65 |
+
# Generate docstrings for the module's functions and methods
|
66 |
+
module = Jira
|
67 |
+
module_name = "atlassian.Jira"
|
68 |
|
69 |
+
docs = generator.generate_module_docs(module, module_name)
|
70 |
print(docs)
|
71 |
```
|
72 |
|
73 |
```python
|
74 |
+
from pip_library_parser import CodeToDocGenerator
|
75 |
+
|
76 |
+
# Instantiate the CodeToDocGenerator
|
77 |
+
generator = CodeToDocGenerator()
|
78 |
|
79 |
code_snippet = """
|
80 |
def example_function(x):
|
81 |
return x * 2
|
82 |
"""
|
83 |
|
84 |
+
docstring = generator.generate_docstring_from_pip_model(code_snippet)
|
85 |
print("Generated Docstring:")
|
86 |
print(docstring)
|
87 |
```
|