diff --git a/.gitattributes b/.gitattributes index e87c15e..ebebf5c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -25,5 +25,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zstandard filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text -track *.jpg -track *.png +.png +.jpg diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 4c45518..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,13 +0,0 @@ -[build-system] -requires = ["setuptools>=64.0.0", "wheel", "requests"] -build-backend = "setuptools.build_meta" - -[project] -name = "techdocs" -version = "0.1.1" -description = "Code documentation generation CLI App" -readme = "README.md" -authors = [{ name = "Techdocs", email = "test@test.com" }] - -[project.scripts] -techdocs = "techdocs.cli:main" \ No newline at end of file diff --git a/techdocs/utils/__init__.py b/techdocs/README.md similarity index 100% rename from techdocs/utils/__init__.py rename to techdocs/README.md diff --git a/techdocs/__init__.py b/techdocs/__init__.py deleted file mode 100644 index d1f2e39..0000000 --- a/techdocs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.1.1" \ No newline at end of file diff --git a/techdocs/pyproject.toml b/techdocs/pyproject.toml new file mode 100644 index 0000000..0c692f6 --- /dev/null +++ b/techdocs/pyproject.toml @@ -0,0 +1,27 @@ +[build-system] +requires = [ + "setuptools >= 65", + "wheel >= 0.38" +] +build-backend = "setuptools.build_meta" + +[project] +name = "techdocs" +version = "0.1.4" +description = "Code documentation generation CLI App" +readme = "README.md" +requires-python = ">=3.10" +authors = [ + {"name" = "test", "email" = "alfatrion123@gmail.com"}, +] +dependencies = [ + "requests", +] +scripts = {techdocs = "techdocs.cli:main"} + + +[tool.setuptools] +packages = ["techdocs"] + +[tool.setuptools.package-data] +"*" = ["*.json"] \ No newline at end of file diff --git a/setup.cfg b/techdocs/setup.cfg similarity index 91% rename from setup.cfg rename to techdocs/setup.cfg index 7c549ac..73747bb 100644 --- a/setup.cfg +++ b/techdocs/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = techdocs -version = 0.1.1 +version = 0.1.4 [options] packages = techdocs diff --git a/setup.py b/techdocs/setup.py similarity index 73% rename from setup.py rename to techdocs/setup.py index e555dcb..549c8b1 100644 --- a/setup.py +++ b/techdocs/setup.py @@ -1,17 +1,23 @@ import setuptools from setuptools import setup +import glob setup( name='techdocs', - version='0.1.1', + version='0.1.4', # To provide executable scripts, use entry points in preference to the # "scripts" keyword. Entry points provide cross-platform support and allow # pip to create the appropriate form of executable for the target platform. entry_points={ 'console_scripts': [ 'techdocs=techdocs.cli:main' - ] + ], }, + python_requires='>=3.10', + + + data_files=glob.glob('techdocs/signatures/**'), + include_package_data=True, packages=setuptools.find_packages(), ) \ No newline at end of file diff --git a/techdocs/techdocs/README.md b/techdocs/techdocs/README.md new file mode 100644 index 0000000..e69de29 diff --git a/techdocs/techdocs/__init__.py b/techdocs/techdocs/__init__.py new file mode 100644 index 0000000..51e0a06 --- /dev/null +++ b/techdocs/techdocs/__init__.py @@ -0,0 +1 @@ +__version__ = "0.1.4" \ No newline at end of file diff --git a/techdocs/cli.py b/techdocs/techdocs/cli.py similarity index 100% rename from techdocs/cli.py rename to techdocs/techdocs/cli.py diff --git a/techdocs/dtypes.py b/techdocs/techdocs/dtypes.py similarity index 100% rename from techdocs/dtypes.py rename to techdocs/techdocs/dtypes.py diff --git a/techdocs/ops.py b/techdocs/techdocs/ops.py similarity index 96% rename from techdocs/ops.py rename to techdocs/techdocs/ops.py index 5806391..1159d83 100644 --- a/techdocs/ops.py +++ b/techdocs/techdocs/ops.py @@ -1,6 +1,8 @@ import argparse import json from typing import Dict, List, Optional, Any, Callable +import importlib.resources + import techdocs from .dtypes import data_types @@ -67,7 +69,7 @@ def bind(self, func: Callable): class Ops: sub_commands: Dict[str, _SubCommand] = {} - with open('techdocs/utils/subcommand_signatures.json') as f: + with importlib.resources.open_text('techdocs.signatures', 'subcommand_signatures.json') as f: encoded_sub_commands = json.load(f) diff --git a/techdocs/utils/subcommand_signatures.json b/techdocs/techdocs/signatures/subcommand_signatures.json similarity index 100% rename from techdocs/utils/subcommand_signatures.json rename to techdocs/techdocs/signatures/subcommand_signatures.json diff --git a/techdocs/techdocs/utils/__init__.py b/techdocs/techdocs/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/techdocs/utils/functools.py b/techdocs/techdocs/utils/functools.py similarity index 97% rename from techdocs/utils/functools.py rename to techdocs/techdocs/utils/functools.py index 011304b..eb1ce51 100644 --- a/techdocs/utils/functools.py +++ b/techdocs/techdocs/utils/functools.py @@ -62,7 +62,7 @@ def issue_api_key(config): ) if (response.status_code!=200): raise Exception("API Key Generation Failed") - print(f"$ API_KEY: {response.json()['api_key']}") + print(f"$ API_KEY:{response.json()['api_key']}") except Exception as e: print(f"$ {e}") diff --git a/techdocs/utils/parse.py b/techdocs/techdocs/utils/parse.py similarity index 100% rename from techdocs/utils/parse.py rename to techdocs/techdocs/utils/parse.py diff --git a/testing/DBQueries.py b/testing/DBQueries.py index 3fe0cfe..b8740d6 100644 --- a/testing/DBQueries.py +++ b/testing/DBQueries.py @@ -23,6 +23,7 @@ def insert_to_database(cls, table_name: str, data: Union[Tuple, List[Tuple]], co Returns: None """ + "\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 " "\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 " "\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 " con = DBConnection.get_client() diff --git a/testing/test.py b/testing/test.py index c608b42..42cff29 100644 --- a/testing/test.py +++ b/testing/test.py @@ -10,6 +10,7 @@ def add(a, b): int: The sum of the two numbers. """ '\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 ' + '\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 ' return a + b def multiply(a, b): @@ -30,6 +31,7 @@ def multiply(a, b): None """ + '\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 ' '\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 ' return a * b @@ -44,6 +46,7 @@ def subtract(a, b): Returns: int: The result of the subtraction. """ + '\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 ' '\ndef subtract(a, b):\n ' return a - b @@ -61,6 +64,7 @@ def divide(a, b): Returns: float: The result of the division of the first argument by the second argument. """ + "\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 " "\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 " if b == 0: raise ValueError('Cannot divide by zero') @@ -68,40 +72,39 @@ def divide(a, b): def func(*args, **kwargs): """ -Usage: query(input_string, search_terms, search_type='AND') - -This function searches for specified terms within the input string using a specified search type. + This function searches for specified terms within the input string using a specified search type. -Parameters: -- input_string (str): The string to search within. -- search_terms (list): A list of strings to search for within the input_string. -- search_type (str, optional): Specifies how the search_terms should be searched within the input_string. - 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'. + Parameters: + - input_string (str): The string to search within. + - search_terms (list): A list of strings to search for within the input_string. + - search_type (str, optional): Specifies how the search_terms should be searched within the input_string. + 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'. -Returns: -- search_results (list): A list of all occurrences of the search_terms within the input_string. + Returns: + - search_results (list): A list of all occurrences of the search_terms within the input_string. -Raises: -- ValueError: If the search_type is not 'AND' or 'OR'. -""" + Raises: + - ValueError: If the search_type is not 'AND' or 'OR'. + """ + "\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" "\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" def wrapper(*args, **kwargs): """ - This function performs a specific operation on the given arguments. + This function acts as a wrapper for another function, allowing it to be called with a variety of arguments. Arguments: - arg1 -- a string argument (default: None) - arg2 -- an integer argument (default: None) - arg3 -- a floating point number argument (default: None) - arg4 -- a boolean argument (default: None) + *args (list): any number of positional arguments (default: None) + **kwargs (dict): any number of keyword arguments (default: None) Returns: - None + Whatever the wrapped function returns (default: None) Raises: - TypeError -- If any argument is not of the expected type. + Whatever exceptions the wrapped function raises (default: None) + TypeError: If any argument is not of the expected type. """ + '\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 ' '\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 ' return func(*args, **kwargs) return wrapper \ No newline at end of file