This repository provides a collection of automation scripts useful for Python project development. These tools enhance development efficiency by automating common tasks such as generating directory structures, managing __init__.py files, creating dependency lists, and cleaning up unnecessary files.
1. Automatic Directory Structure Generation
- Automatically creates the necessary directory structure for projects
- Quickly set up the basic structure when starting a new project
2. __init__.py File Generation
- Automatically generates
__init__.pyfiles for Python package structures - Makes directories recognizable as Python modules for easier imports
3. Requirements.txt File Generation
- Saves dependency packages in a
requirements.txtfile - Simplifies environment replication and dependency management
4. Cleaning Unnecessary Files
- Removes
.DS_Storefiles and hidden files with._prefixes - Especially useful for cleaning metadata files generated on macOS
generate_dir_structure.py
- Function: Automatically creates the necessary directory structure for a project
- Helps maintain consistent project organization across different projects
- Saves time when setting up new project environments
generate_init_files.py
- Function: Automatically generates
__init__.pyfiles in specified directories and their subdirectories - Ensures proper Python package structure to enable module imports
- Supports code organization through directory modularization
generate_requirements_txt.py
- Function: Saves the list of installed packages in the current environment to a
requirements.txtfile - Stores the file in the path specified by the command line argument (
sys.argv[1]) - Provides the ability to include additional requirements as needed
delete_DS.py
- Function: Recursively finds and deletes
.DS_Storefiles and files with._prefixes - Allows specifying the directory to clean via command line arguments (
argv) - Useful for cleaning unnecessary metadata files, particularly in macOS environments
__init__.py
- Function: Used for package initialization settings
- Current version provides streamlined initialization with empty functions removed
python generate_dir_structure.py [path]Creates the basic project directory structure at the specified path.
python generate_init_files.py [path]Creates __init__.py files in all subdirectories of the specified path.
python generate_requirements_txt.py [save_path] [additional_requirements]Saves the list of packages from the current environment to a requirements.txt file at the specified path. Optionally, specify additional requirements.
python delete_DS.py [path]Recursively finds and deletes .DS_Store files and files with ._ prefixes in the specified path.
- Clone this repository:
git clone https://github.com/username/repository-name.git- Install the necessary dependencies:
pip install -r requirements.txtWhen starting a new project, you can use the scripts as follows:
- First, generate the directory structure:
python generate_dir_structure.py new_project- Add
__init__.pyfiles to the generated directories:
python generate_init_files.py new_project- Generate the list of project dependencies:
python generate_requirements_txt.py new_project- Clean up unnecessary files:
python delete_DS.py new_projectIf you wish to contribute to this project, please follow these steps:
- Fork this repository
- Develop new features or fix bugs
- Commit and push your changes
- Submit a pull request
All types of contributions are welcome!
This project is distributed under the [License Name]. See the LICENSE file for details.