avi-pipable commited on
Commit
f4b05e8
·
verified ·
1 Parent(s): bfb4e54

Updated Library use in README

Browse files

Update the example code according to latest [v0.2.0](https://github.com/PipableAI/pip-library-parser/releases/tag/v0.2.0)

Files changed (1) hide show
  1. README.md +15 -6
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
- from pip_library_parser import generate_module_docs
58
- from atlassian.jira import Jira
59
 
 
 
60
 
61
- torch.set_default_device("cuda")
 
 
62
 
63
- docs = generate_module_docs(Jira, "atlassian.jira.Jira")
64
  print(docs)
65
  ```
66
 
67
  ```python
68
- from pip_library_parser import generate_docstring_from_pip_model
 
 
 
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
  ```