FileContentsExtractor is a robust Python utility designed to simplify file management within directory structures. It excels at organizing projects where filenames leverage numerical prefixes, automating a previously tedious task.
Key Benefits:
- Streamlined Organization: Effortlessly organize files based on numeric prefixes, ensuring a well-structured directory layout.
- Intelligent Sorting: Leverages sophisticated algorithms to sort file names meticulously, including those with decimals, for intuitive retrieval.
- Duplicate Elimination: Maintains data integrity by meticulously removing duplicate entries, resulting in clean and accurate output.
- Customized File Output: Generates dedicated text files (
.txt
) for each folder, providing clear overviews of sorted and unique filenames.
Technical Specifications:
- Programming Language: Python 3.x (ensuring broad compatibility)
- Dependencies:
os
module (built-in, facilitates operating system interactions)re
module (built-in, empowers powerful regular expression pattern matching)
Installation:
-
Clone the Repository:
git clone https://github.com/Mohammed-abdulaziz-eisa/FileContentsExtractor.git
-
Navigate to the cloned repository:
cd FileContentsExtractor
-
optional Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install any necessary dependencies:
pip install -r requirements.txt
- Place the script in the directory you want to organize.
- Run the script:
python FileContentsExtractor.py
- The script will create a text file for each folder in the current directory, named foldername_contents.txt, containing the sorted file names.
Consider a folder named "3. Model-to-App Packaging Production Codebase Design". The script will create a file named "3. Model-to-App Packaging Production Codebase Design_contents.txt". The contents might resemble:
- From Jupyter to Application Code Transformation
- Python Dependency Management Setup with Poetry
- Python Parametrization Setup with Pydantic
- Python Logging Setup with Loguru
- Database Setup and Python Connectivity with Sqlalchemy
We actively encourage your contributions! If you possess valuable suggestions or enhancements for this utility, feel free to submit a pull request through the project's repository.
FileContentsExtractor is open-source software, distributed under the permissive MIT License. Refer to the LICENSE file for comprehensive details.