This directory contains scripts designed to automate the creation of project structures, making it easier to set up and organize your development environment. These scripts help you quickly scaffold new projects with pre-defined directory structures, saving time and effort.
The pyproj.sh
script automates the creation of Python project structures, saving time and providing a clean, scalable, and standardized organization for your projects. Whether you're using FastAPI, Flask, or Django, this tool adapts to your needs.
- Creates a complete project structure, including the following directories:
app/ ├── routers/ ├── schemas/ ├── services/ ├── repositories/ ├── models/ ├── middleware/ ├── utils/ └── config/ migrations/ tests/ docs/
- Adds
__init__.py
files to make directories Python packages. - Generates a
README.md
file for basic project documentation. - Works out-of-the-box for common Python frameworks.
- Fully customizable for unique project requirements.
- Clone the repository:
git clone https://github.com/higorcazuza81/dev-utils.git cd dev-utils
- Make the script executable:
chmod +x project_automation/pyproj.sh
- Run the script:
./project_automation/pyproj.sh <project_name>
To simplify usage and allow running the script from anywhere:
-
Move the script to a custom
bin
directory:mkdir -p ~/bin cp project_automation/pyproj.sh ~/bin/
-
Make the script executable:
chmod +x ~/bin/pyproj.sh
-
Add
bin
to your PATH:- Open your shell configuration file (
~/.zshrc
or~/.bashrc
). - Add this line:
export PATH="$HOME/bin:$PATH"
- Apply the changes:
source ~/.zshrc
- Open your shell configuration file (
-
Rename for convenience (optional):
mv ~/bin/pyproj.sh ~/bin/pyproj
Now you can run:
pyproj <project_name>
Run the script with your desired project name:
pyproj <project_name>
pyproj my_project
This will create the following structure:
my_project/
├── app/
│ ├── routers/
│ ├── schemas/
│ ├── services/
│ ├── repositories/
│ ├── models/
│ ├── middleware/
│ ├── utils/
│ └── config/
├── migrations/
├── tests/
├── docs/
└── README.md
The script is fully customizable. Edit the pyproj.sh
file to:
- Add/remove directories.
- Create additional files, like
.gitignore
,setup.py
, or environment configuration files. - Adapt the structure for specific frameworks or workflows.
Example: Add a .gitignore
file or a main.py
for FastAPI.
-
Script not found:
Ensure thebin
directory is in your PATH:echo $PATH
If not, recheck your shell configuration file and restart the terminal.
-
Permission issues:
If you see a "Permission Denied" error, ensure the script is executable:chmod +x ~/bin/pyproj
-
Incorrect structure:
Check the script content to verify the directories and files being created match your needs.
-
Quick Setup with Aliases:
Add an alias for the script in your shell configuration:alias pyproj='~/bin/pyproj'
-
Default Directory:
Modify the script to always create projects in a specific directory, e.g.,~/projects
.
- Operating System: Linux or macOS.
- Shell: Bash or Zsh (default on most systems).
Ensurebash
is installed and available.
The sqlproj.sh
script will automate the creation of SQL project structures, helping you organize your database schemas, queries, and migrations.
- Create directories for
schemas
,queries
,migrations
, andseeds
. - Organize SQL files by categories, such as
dml
,ddl
,views
, etc. - Add placeholders for migration scripts and configuration files.
More details will be available once the script is completed.
-
Clone the repository (if you haven’t already):
git clone https://github.com/your-username/dev-utils.git cd dev-utils
-
Make the script executable:
chmod +x project_automation/sqlproj.sh
-
Run the script with your project name as an argument:
./project_automation/sqlproj.sh my_sql_project
my_sql_project/
├── schemas/
│ ├── tables/
│ ├── views/
│ └── functions/
├── queries/
├── migrations/
└── seeds/
Both scripts are designed to be easily customizable:
- You can modify the directories created or adjust the naming conventions to fit your project's needs.
- The scripts are written in bash, so you can easily update or extend them by editing the shell commands inside the script files.
Feel free to fork the repository, contribute improvements, or suggest new features. If you encounter any issues or have suggestions, please submit them via the GitHub Issues page.
This project is licensed under the MIT License.