Spaces:
Runtime error
Runtime error
Merge pull request #34 from mayureshagashe2105/main
Browse files- .gitattributes +2 -2
- techdocs/{utils/__init__.py β README.md} +0 -0
- techdocs/__init__.py +0 -1
- pyproject.toml β techdocs/pyproject.toml +19 -5
- setup.cfg β techdocs/setup.cfg +1 -1
- setup.py β techdocs/setup.py +8 -2
- techdocs/techdocs/README.md +0 -0
- techdocs/techdocs/__init__.py +1 -0
- techdocs/{cli.py β techdocs/cli.py} +0 -0
- techdocs/{dtypes.py β techdocs/dtypes.py} +0 -0
- techdocs/{ops.py β techdocs/ops.py} +3 -1
- techdocs/{utils β techdocs/signatures}/subcommand_signatures.json +0 -0
- techdocs/techdocs/utils/__init__.py +0 -0
- techdocs/{utils β techdocs/utils}/functools.py +1 -1
- techdocs/{utils β techdocs/utils}/parse.py +0 -0
- testing/DBQueries.py +1 -0
- testing/test.py +23 -20
.gitattributes
CHANGED
@@ -25,5 +25,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
-
|
29 |
-
|
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
.png
|
29 |
+
.jpg
|
techdocs/{utils/__init__.py β README.md}
RENAMED
File without changes
|
techdocs/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
__version__ = "0.1.1"
|
|
|
|
pyproject.toml β techdocs/pyproject.toml
RENAMED
@@ -1,13 +1,27 @@
|
|
1 |
[build-system]
|
2 |
-
requires = [
|
|
|
|
|
|
|
3 |
build-backend = "setuptools.build_meta"
|
4 |
|
5 |
[project]
|
6 |
name = "techdocs"
|
7 |
-
version = "0.1.
|
8 |
description = "Code documentation generation CLI App"
|
9 |
readme = "README.md"
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
1 |
[build-system]
|
2 |
+
requires = [
|
3 |
+
"setuptools >= 65",
|
4 |
+
"wheel >= 0.38"
|
5 |
+
]
|
6 |
build-backend = "setuptools.build_meta"
|
7 |
|
8 |
[project]
|
9 |
name = "techdocs"
|
10 |
+
version = "0.1.4"
|
11 |
description = "Code documentation generation CLI App"
|
12 |
readme = "README.md"
|
13 |
+
requires-python = ">=3.10"
|
14 |
+
authors = [
|
15 |
+
{"name" = "test", "email" = "[email protected]"},
|
16 |
+
]
|
17 |
+
dependencies = [
|
18 |
+
"requests",
|
19 |
+
]
|
20 |
+
scripts = {techdocs = "techdocs.cli:main"}
|
21 |
|
22 |
+
|
23 |
+
[tool.setuptools]
|
24 |
+
packages = ["techdocs"]
|
25 |
+
|
26 |
+
[tool.setuptools.package-data]
|
27 |
+
"*" = ["*.json"]
|
setup.cfg β techdocs/setup.cfg
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
[metadata]
|
2 |
name = techdocs
|
3 |
-
version = 0.1.
|
4 |
|
5 |
[options]
|
6 |
packages = techdocs
|
|
|
1 |
[metadata]
|
2 |
name = techdocs
|
3 |
+
version = 0.1.4
|
4 |
|
5 |
[options]
|
6 |
packages = techdocs
|
setup.py β techdocs/setup.py
RENAMED
@@ -1,17 +1,23 @@
|
|
1 |
import setuptools
|
2 |
from setuptools import setup
|
|
|
3 |
|
4 |
setup(
|
5 |
name='techdocs',
|
6 |
-
version='0.1.
|
7 |
# To provide executable scripts, use entry points in preference to the
|
8 |
# "scripts" keyword. Entry points provide cross-platform support and allow
|
9 |
# pip to create the appropriate form of executable for the target platform.
|
10 |
entry_points={
|
11 |
'console_scripts': [
|
12 |
'techdocs=techdocs.cli:main'
|
13 |
-
]
|
14 |
},
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
packages=setuptools.find_packages(),
|
17 |
)
|
|
|
1 |
import setuptools
|
2 |
from setuptools import setup
|
3 |
+
import glob
|
4 |
|
5 |
setup(
|
6 |
name='techdocs',
|
7 |
+
version='0.1.4',
|
8 |
# To provide executable scripts, use entry points in preference to the
|
9 |
# "scripts" keyword. Entry points provide cross-platform support and allow
|
10 |
# pip to create the appropriate form of executable for the target platform.
|
11 |
entry_points={
|
12 |
'console_scripts': [
|
13 |
'techdocs=techdocs.cli:main'
|
14 |
+
],
|
15 |
},
|
16 |
+
python_requires='>=3.10',
|
17 |
+
|
18 |
+
|
19 |
+
data_files=glob.glob('techdocs/signatures/**'),
|
20 |
+
include_package_data=True,
|
21 |
|
22 |
packages=setuptools.find_packages(),
|
23 |
)
|
techdocs/techdocs/README.md
ADDED
File without changes
|
techdocs/techdocs/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
__version__ = "0.1.4"
|
techdocs/{cli.py β techdocs/cli.py}
RENAMED
File without changes
|
techdocs/{dtypes.py β techdocs/dtypes.py}
RENAMED
File without changes
|
techdocs/{ops.py β techdocs/ops.py}
RENAMED
@@ -1,6 +1,8 @@
|
|
1 |
import argparse
|
2 |
import json
|
3 |
from typing import Dict, List, Optional, Any, Callable
|
|
|
|
|
4 |
|
5 |
import techdocs
|
6 |
from .dtypes import data_types
|
@@ -67,7 +69,7 @@ class _SubCommand:
|
|
67 |
|
68 |
class Ops:
|
69 |
sub_commands: Dict[str, _SubCommand] = {}
|
70 |
-
with
|
71 |
encoded_sub_commands = json.load(f)
|
72 |
|
73 |
|
|
|
1 |
import argparse
|
2 |
import json
|
3 |
from typing import Dict, List, Optional, Any, Callable
|
4 |
+
import importlib.resources
|
5 |
+
|
6 |
|
7 |
import techdocs
|
8 |
from .dtypes import data_types
|
|
|
69 |
|
70 |
class Ops:
|
71 |
sub_commands: Dict[str, _SubCommand] = {}
|
72 |
+
with importlib.resources.open_text('techdocs.signatures', 'subcommand_signatures.json') as f:
|
73 |
encoded_sub_commands = json.load(f)
|
74 |
|
75 |
|
techdocs/{utils β techdocs/signatures}/subcommand_signatures.json
RENAMED
File without changes
|
techdocs/techdocs/utils/__init__.py
ADDED
File without changes
|
techdocs/{utils β techdocs/utils}/functools.py
RENAMED
@@ -62,7 +62,7 @@ def issue_api_key(config):
|
|
62 |
)
|
63 |
if (response.status_code!=200):
|
64 |
raise Exception("API Key Generation Failed")
|
65 |
-
print(f"$ API_KEY:
|
66 |
except Exception as e:
|
67 |
print(f"$ {e}")
|
68 |
|
|
|
62 |
)
|
63 |
if (response.status_code!=200):
|
64 |
raise Exception("API Key Generation Failed")
|
65 |
+
print(f"$ API_KEY:{response.json()['api_key']}")
|
66 |
except Exception as e:
|
67 |
print(f"$ {e}")
|
68 |
|
techdocs/{utils β techdocs/utils}/parse.py
RENAMED
File without changes
|
testing/DBQueries.py
CHANGED
@@ -23,6 +23,7 @@ class DBQueries:
|
|
23 |
Returns:
|
24 |
None
|
25 |
"""
|
|
|
26 |
"\n This method is used to insert data into a specified table in the database.\n\n Args:\n table_name (str): The name of the table into which the data will be inserted.\n data (Union[Tuple, List[Tuple]]): The data to be inserted into the table. It can be either a tuple or a list of tuples.\n cols (List[str], optional): A list of column names in the table. If not provided, the method will assume all columns are needed. Defaults to None.\n\n Raises:\n Exception: If the data type of 'data' is not a tuple or a list of tuples.\n\n Returns:\n None\n "
|
27 |
"\n This method is used to insert data into a specified table in the database.\n\n Args:\n table_name (str): The name of the table into which the data will be inserted.\n data (Union[Tuple, List[Tuple]]): The data to be inserted into the table. It can be either a tuple or a list of tuples.\n cols (List[str], optional): A list of column names in the table. If not provided, the method will assume all columns are needed. Defaults to None.\n\n Raises:\n Exception: If the data type of 'data' is not a tuple or a list of tuples.\n\n Returns:\n None\n "
|
28 |
con = DBConnection.get_client()
|
|
|
23 |
Returns:
|
24 |
None
|
25 |
"""
|
26 |
+
"\n This method is used to insert data into a specified table in the database.\n\n Args:\n table_name (str): The name of the table into which the data will be inserted.\n data (Union[Tuple, List[Tuple]]): The data to be inserted into the table. It can be either a tuple or a list of tuples.\n cols (List[str], optional): A list of column names in the table. If not provided, the method will assume all columns are needed. Defaults to None.\n\n Raises:\n Exception: If the data type of 'data' is not a tuple or a list of tuples.\n\n Returns:\n None\n "
|
27 |
"\n This method is used to insert data into a specified table in the database.\n\n Args:\n table_name (str): The name of the table into which the data will be inserted.\n data (Union[Tuple, List[Tuple]]): The data to be inserted into the table. It can be either a tuple or a list of tuples.\n cols (List[str], optional): A list of column names in the table. If not provided, the method will assume all columns are needed. Defaults to None.\n\n Raises:\n Exception: If the data type of 'data' is not a tuple or a list of tuples.\n\n Returns:\n None\n "
|
28 |
"\n This method is used to insert data into a specified table in the database.\n\n Args:\n table_name (str): The name of the table into which the data will be inserted.\n data (Union[Tuple, List[Tuple]]): The data to be inserted into the table. It can be either a tuple or a list of tuples.\n cols (List[str], optional): A list of column names in the table. If not provided, the method will assume all columns are needed. Defaults to None.\n\n Raises:\n Exception: If the data type of 'data' is not a tuple or a list of tuples.\n\n Returns:\n None\n "
|
29 |
con = DBConnection.get_client()
|
testing/test.py
CHANGED
@@ -10,6 +10,7 @@ def add(a, b):
|
|
10 |
int: The sum of the two numbers.
|
11 |
"""
|
12 |
'\n This function adds two numbers.\n\n Arguments:\n a (int): The first number to be added.\n b (int): The second number to be added.\n\n Returns:\n int: The sum of the two numbers.\n '
|
|
|
13 |
return a + b
|
14 |
|
15 |
def multiply(a, b):
|
@@ -30,6 +31,7 @@ def multiply(a, b):
|
|
30 |
None
|
31 |
|
32 |
"""
|
|
|
33 |
'\n This function multiplies two numbers.\n\n Args:\n a: A number to be multiplied.\n b: Another number to be multiplied.\n\n Returns:\n The product of the two numbers.\n '
|
34 |
return a * b
|
35 |
|
@@ -44,6 +46,7 @@ def subtract(a, b):
|
|
44 |
Returns:
|
45 |
int: The result of the subtraction.
|
46 |
"""
|
|
|
47 |
'\ndef subtract(a, b):\n '
|
48 |
return a - b
|
49 |
|
@@ -61,6 +64,7 @@ def divide(a, b):
|
|
61 |
Returns:
|
62 |
float: The result of the division of the first argument by the second argument.
|
63 |
"""
|
|
|
64 |
"\n This function divides the first argument by the second argument.\n\n Arguments:\n a -- The first number to be divided. It should be of type float.\n b -- The second number to be divided. It should be of type float.\n\n Raises:\n ValueError -- If the second argument is zero, it raises a ValueError with the message 'Cannot divide by zero'.\n\n Returns:\n float -- The result of the division of the first argument by the second argument.\n "
|
65 |
if b == 0:
|
66 |
raise ValueError('Cannot divide by zero')
|
@@ -68,40 +72,39 @@ def divide(a, b):
|
|
68 |
|
69 |
def func(*args, **kwargs):
|
70 |
"""
|
71 |
-
|
72 |
-
|
73 |
-
This function searches for specified terms within the input string using a specified search type.
|
74 |
|
75 |
-
Parameters:
|
76 |
-
- input_string (str): The string to search within.
|
77 |
-
- search_terms (list): A list of strings to search for within the input_string.
|
78 |
-
- search_type (str, optional): Specifies how the search_terms should be searched within the input_string.
|
79 |
-
|
80 |
|
81 |
-
Returns:
|
82 |
-
- search_results (list): A list of all occurrences of the search_terms within the input_string.
|
83 |
|
84 |
-
Raises:
|
85 |
-
- ValueError: If the search_type is not 'AND' or 'OR'.
|
86 |
-
"""
|
|
|
87 |
"\nUsage: func(*args, **kwargs)\n\nThis function returns a wrapper function that calls the original function.\n\nParameters:\n- args (tuple): A tuple of non-keyworded arguments to pass to the function.\n- kwargs (dict): A dictionary of keyworded arguments to pass to the function.\n\nReturns:\n- wrapper (function): A new function that calls the original function with the given arguments.\n\nRaises:\n- TypeError: If the arguments passed to the wrapper function do not match the original function's signature.\n"
|
88 |
|
89 |
def wrapper(*args, **kwargs):
|
90 |
"""
|
91 |
-
This function
|
92 |
|
93 |
Arguments:
|
94 |
-
|
95 |
-
|
96 |
-
arg3 -- a floating point number argument (default: None)
|
97 |
-
arg4 -- a boolean argument (default: None)
|
98 |
|
99 |
Returns:
|
100 |
-
None
|
101 |
|
102 |
Raises:
|
103 |
-
|
|
|
104 |
"""
|
|
|
105 |
'\n This function acts as a wrapper for another function, allowing it to be called with a variety of arguments.\n\n Arguments:\n *args -- any number of positional arguments (default: None)\n **kwargs -- any number of keyword arguments (default: None)\n\n Returns:\n Whatever the wrapped function returns (default: None)\n\n Raises:\n Whatever exceptions the wrapped function raises (default: None)\n '
|
106 |
return func(*args, **kwargs)
|
107 |
return wrapper
|
|
|
10 |
int: The sum of the two numbers.
|
11 |
"""
|
12 |
'\n This function adds two numbers.\n\n Arguments:\n a (int): The first number to be added.\n b (int): The second number to be added.\n\n Returns:\n int: The sum of the two numbers.\n '
|
13 |
+
'\n This function adds two numbers.\n\n Arguments:\n a (int): The first number to be added.\n b (int): The second number to be added.\n\n Returns:\n int: The sum of the two numbers.\n '
|
14 |
return a + b
|
15 |
|
16 |
def multiply(a, b):
|
|
|
31 |
None
|
32 |
|
33 |
"""
|
34 |
+
'\n This function multiplies two numbers.\n\n Args:\n a: A number to be multiplied.\n This should be a numeric value (int or float).\n b: Another number to be multiplied.\n This should be a numeric value (int or float).\n\n Returns:\n The product of the two numbers.\n This will be a numeric value (int or float), representing the result of the multiplication.\n\n Raises:\n None\n\n '
|
35 |
'\n This function multiplies two numbers.\n\n Args:\n a: A number to be multiplied.\n b: Another number to be multiplied.\n\n Returns:\n The product of the two numbers.\n '
|
36 |
return a * b
|
37 |
|
|
|
46 |
Returns:
|
47 |
int: The result of the subtraction.
|
48 |
"""
|
49 |
+
'\n Subtracts the second number from the first.\n\n Args:\n a (int): The first number to be subtracted.\n b (int): The second number to be subtracted from the first.\n\n Returns:\n int: The result of the subtraction.\n '
|
50 |
'\ndef subtract(a, b):\n '
|
51 |
return a - b
|
52 |
|
|
|
64 |
Returns:
|
65 |
float: The result of the division of the first argument by the second argument.
|
66 |
"""
|
67 |
+
"\n This function divides the first argument by the second argument.\n\n Arguments:\n a (float): The first number to be divided.\n b (float): The second number to be divided.\n\n Raises:\n ValueError: If the second argument is zero, it raises a ValueError with the message 'Cannot divide by zero'.\n\n Returns:\n float: The result of the division of the first argument by the second argument.\n "
|
68 |
"\n This function divides the first argument by the second argument.\n\n Arguments:\n a -- The first number to be divided. It should be of type float.\n b -- The second number to be divided. It should be of type float.\n\n Raises:\n ValueError -- If the second argument is zero, it raises a ValueError with the message 'Cannot divide by zero'.\n\n Returns:\n float -- The result of the division of the first argument by the second argument.\n "
|
69 |
if b == 0:
|
70 |
raise ValueError('Cannot divide by zero')
|
|
|
72 |
|
73 |
def func(*args, **kwargs):
|
74 |
"""
|
75 |
+
This function searches for specified terms within the input string using a specified search type.
|
|
|
|
|
76 |
|
77 |
+
Parameters:
|
78 |
+
- input_string (str): The string to search within.
|
79 |
+
- search_terms (list): A list of strings to search for within the input_string.
|
80 |
+
- search_type (str, optional): Specifies how the search_terms should be searched within the input_string.
|
81 |
+
Possible values: 'AND' (all search_terms must be present in the input_string), 'OR' (at least one search_term must be present in the input_string). Default is 'AND'.
|
82 |
|
83 |
+
Returns:
|
84 |
+
- search_results (list): A list of all occurrences of the search_terms within the input_string.
|
85 |
|
86 |
+
Raises:
|
87 |
+
- ValueError: If the search_type is not 'AND' or 'OR'.
|
88 |
+
"""
|
89 |
+
"\nUsage: query(input_string, search_terms, search_type='AND')\n\nThis function searches for specified terms within the input string using a specified search type.\n\nParameters:\n- input_string (str): The string to search within.\n- search_terms (list): A list of strings to search for within the input_string.\n- search_type (str, optional): Specifies how the search_terms should be searched within the input_string.\n Possible values: 'AND' (all search_terms must be present in the input_string), 'OR' (at least one search_term must be present in the input_string). Default is 'AND'.\n\nReturns:\n- search_results (list): A list of all occurrences of the search_terms within the input_string.\n\nRaises:\n- ValueError: If the search_type is not 'AND' or 'OR'.\n"
|
90 |
"\nUsage: func(*args, **kwargs)\n\nThis function returns a wrapper function that calls the original function.\n\nParameters:\n- args (tuple): A tuple of non-keyworded arguments to pass to the function.\n- kwargs (dict): A dictionary of keyworded arguments to pass to the function.\n\nReturns:\n- wrapper (function): A new function that calls the original function with the given arguments.\n\nRaises:\n- TypeError: If the arguments passed to the wrapper function do not match the original function's signature.\n"
|
91 |
|
92 |
def wrapper(*args, **kwargs):
|
93 |
"""
|
94 |
+
This function acts as a wrapper for another function, allowing it to be called with a variety of arguments.
|
95 |
|
96 |
Arguments:
|
97 |
+
*args (list): any number of positional arguments (default: None)
|
98 |
+
**kwargs (dict): any number of keyword arguments (default: None)
|
|
|
|
|
99 |
|
100 |
Returns:
|
101 |
+
Whatever the wrapped function returns (default: None)
|
102 |
|
103 |
Raises:
|
104 |
+
Whatever exceptions the wrapped function raises (default: None)
|
105 |
+
TypeError: If any argument is not of the expected type.
|
106 |
"""
|
107 |
+
'\n This function performs a specific operation on the given arguments.\n\n Arguments:\n arg1 -- a string argument (default: None)\n arg2 -- an integer argument (default: None)\n arg3 -- a floating point number argument (default: None)\n arg4 -- a boolean argument (default: None)\n\n Returns:\n None\n\n Raises:\n TypeError -- If any argument is not of the expected type.\n '
|
108 |
'\n This function acts as a wrapper for another function, allowing it to be called with a variety of arguments.\n\n Arguments:\n *args -- any number of positional arguments (default: None)\n **kwargs -- any number of keyword arguments (default: None)\n\n Returns:\n Whatever the wrapped function returns (default: None)\n\n Raises:\n Whatever exceptions the wrapped function raises (default: None)\n '
|
109 |
return func(*args, **kwargs)
|
110 |
return wrapper
|