This Python project contains two primary components:
-
Python Code Analyzer: A script that analyzes Python code to extract details about functions and methods, including arguments, return types, docstrings, dependencies, and whether they are entry points. It also supports class methods and nested functions. Now with the added feature of analyzing all Python files in a given directory.
-
Directory Tree Printer: A script that prints the directory tree for a given path, with options to exclude directories, filter by file type, limit the depth, include file sizes and modification times, and sort by modification time.
- Clone the repository:
git clone https://github.com/isayahc/Chat-GPT-auxillary-scripts-for-code.git
- Navigate to the project directory:
cd Chat-GPT-auxillary-scripts-for-code
- Ensure you have Python 3.8 or later installed. You can verify this with
python --version
.
To use the Python Code Analyzer, run the script with a Python file as an argument:
python python_code_analyzer.py --file <file-to-analyze.py>
Or you can analyze all Python files in a directory:
python python_code_analyzer.py --directory <directory-to-analyze>
To use the Directory Tree Printer, run the script with the directory you want to print:
python directory_tree_printer.py <directory-to-print>
You can customize the output with various options. For example, to print only Python files up to a depth of 2, include file sizes, and sort by modification time, you would run:
python directory_tree_printer.py <directory-to-print> -f "*.py" -d 2 -s --sort
If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.
This project is licensed under the terms of the MIT license.