|
| 1 | +```markdown |
| 2 | +# py-import-scanner |
| 3 | + |
| 4 | +## Description |
| 5 | + |
| 6 | +**py-import-scanner** is a tool designed to scan Python scripts for imported libraries. It allows you to analyze your code and identify all the imported libraries while excluding standard libraries like `os`, `sys`, and others. |
| 7 | + |
| 8 | +The program provides functionality for visualizing the data in the form of histograms and pie charts, showing the count of different imported libraries and their usage in the project. This allows developers to see which libraries they actively use and improve dependency management. |
| 9 | + |
| 10 | +## Features |
| 11 | + |
| 12 | +- Scans Python scripts in the specified directory. |
| 13 | +- Excludes standard libraries and packages listed in `.gitignore`. |
| 14 | +- Generates statistics on imports. |
| 15 | +- Displays histograms and pie charts using `matplotlib`. |
| 16 | +- Option to copy statistics to the clipboard. |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +1. **Clone the repository:** |
| 21 | + |
| 22 | + In the command line or PowerShell, run: |
| 23 | + |
| 24 | + ```bash |
| 25 | + git clone https://github.com/AlgorithmAlchemy/py-import-scanner.git |
| 26 | + cd py-import-scanner |
| 27 | + ``` |
| 28 | + |
| 29 | +2. **Install dependencies:** |
| 30 | + |
| 31 | + Make sure you have Python 3.7 or higher, and then install all the dependencies: |
| 32 | + |
| 33 | + ```bash |
| 34 | + pip install -r requirements.txt |
| 35 | + ``` |
| 36 | + |
| 37 | +## Usage |
| 38 | + |
| 39 | +1. **Run the program:** |
| 40 | + |
| 41 | + To run the program, simply execute the file: |
| 42 | + |
| 43 | + ```bash |
| 44 | + python main.py |
| 45 | + ``` |
| 46 | + |
| 47 | + This will open the graphical interface where you can select a directory to scan. Choose a directory, and the program will begin processing the files. |
| 48 | + |
| 49 | +2. **Graphical Interface:** |
| 50 | + |
| 51 | + The program uses the `Tkinter` library for the graphical interface. You will be able to see: |
| 52 | + - Buttons to select the folder. |
| 53 | + - Statistics on the imports. |
| 54 | + - A histogram and pie chart displaying the frequency of library usage. |
| 55 | + |
| 56 | +3. **Keyboard shortcuts:** |
| 57 | + |
| 58 | + - The **"Select Folder"** button allows you to choose the folder for scanning. |
| 59 | + - The **"Histogram"** and **"Pie Chart"** buttons display the statistics visualization. |
| 60 | + - The statistics can be copied to the clipboard for further use. |
| 61 | + |
| 62 | +## Project Structure |
| 63 | + |
| 64 | +- **main.py** — main script to run the program. |
| 65 | +- **scanner.py** — contains the logic for scanning files. |
| 66 | +- **requirements.txt** — dependencies file for the project. |
| 67 | +- **README.md** — this file with documentation. |
| 68 | +- **assets/** — directory for possible resources (icons, images, etc.). |
| 69 | + |
| 70 | +## Notes |
| 71 | + |
| 72 | +- This project uses libraries for visualization, such as `matplotlib` and `pyperclip`. |
| 73 | +- If you encounter errors or issues with dependencies, you can install them manually using: |
| 74 | + |
| 75 | + ```bash |
| 76 | + pip install matplotlib pyperclip colorama |
| 77 | + ``` |
| 78 | + |
| 79 | +## License |
| 80 | + |
| 81 | +This project is licensed under the MIT License. For more details, see the `LICENSE` file. |
0 commit comments