Skip to content

MarineG404/InitPythonProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐍 Init Python Project

A shell script to bootstrap a new Python project, ready to code in seconds.

⚑ Terminal Shortcut

Add this alias to ~/.bashrc or ~/.zshrc:

alias init-python='bash /path/to/init_python.sh'

πŸ’Ύ How to save the alias

  1. Open your shell configuration file:
  • Bash: ~/.bashrc
  • Zsh: ~/.zshrc
  1. Add this line at the end:
  alias init-python='bash /path/to/init_python.sh'
  1. Save the file

  2. Reload the configuration:

  source ~/.bashrc    # or source ~/.zshrc for zsh

Then run:

  init-python

πŸš€ What happens when you run it

The script asks for:

  1. A project name (default: myPythonProject)
  2. Whether to initialize a Git repository (y/N)

Then it:

  1. Creates the project folder
  2. If Git is enabled, runs git init, creates .gitignore with .venv, creates an initial commit, and renames the branch to main
  3. Creates requirements.txt
  4. Copies main.py and README.md from examples/
  5. Creates a virtual environment in .venv
  6. Activates the virtual environment
  7. Upgrades pip

About

Shell script to bootstrap a new Python project with virtual environment, package management, and starter files

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages