Awesome shell automation for python projects. After being tired of doing the same stuff and running the same commands over and over again for initiating my projects, I decided to create a single command, that automates the whole procedure for me.
This project is inspired by Kalle Hallden
In this repo I’ve provided my version of shell automation for python projects, lets get started.
Install PyGithub, for GitHub integration.
$ pip3 install PyGithub
Install Pyautogui, for automating keyboard to activate the virtual environment, and upgrade the pip.
$ pip3 install pyautogui
Install Python-dotenv, for handeling environment variables in the virtual environment.
$ pip3 install python-dotenv
You need to set 3 environment variables:
GITHUB_USERNAME
: Your github usernameGITHUB_PASSWORD
: Your github passwordPROJECT_PATH
: Path where you want to store all your projectsBACKUP_PATH
: Path where you want to backup all your projects….Checkout these tutorials to get it done
In the shell, run the following commands:
$ git clone https://github.com/braindotai/Shell-Python-Project-Automation.git
$ cd Shell-Python-Project-Automation
$ mv project.py project
$ chmod +x project
$ mkdir ~/bin
$ cp project ~/bin"
$ echo 'export PATH=$PATH":$HOME/bin"' >> .profile
$ cd ..
To create a project
project create <project name> <description> <private (True/False)> <homepage url>
Example:
$ project create “new project” “this is my description for GitHub repository” “False”
[============= Initiating project: new project =============]
Creating Readme file ….
Creating Environment Variables ….
Creating Virtual Environment ….
Initiating Git Integration ….
Initialized empty Git repository in C:/Users/brain/Desktop/Projects/new project/.git/
[master (root-commit) b2963d5] Initial Commit
2 files changed, 3 insertions(+)
create mode 100644 .gitignore
create mode 100644 README.md
Adding remote URL
Pushing initial commit ….
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 282 bytes | 282.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To https://github.com/braindotai/new-project-name.git
[new branch] master -> master
Branch ‘master’ set up to track remote branch ‘master’ from ‘origin’.
Opening project
[============= Project initiated successfully =============]
Now that’s marvelous!!
Setting up you’re project’s environment variables
You can set you’re environment variables in the .vars file.
USERNAME = 'my username'
PASSWORD = 'my passward'
To print names of projects existing in your PROJECT_PATH
project list
Example:
$ project list
1. Custom-Linux-Command-Creator
2. Deep-Learning-Scratch-Arena
3. Dr-Deep
4. Kaggle-Exploratory-Data-Analysis
5. Shell Python Project Automation
To open a project
project open <project name>
Example:
$ project open shell python project automation
To check directories of a project
project <project name>
Example:
$ project shell python project automation
To delete a project
project delete <project name>
Example:
$ project delete new project
Project "new project" is deleted successfully
To print repository details
project repo <repo name>
Example:
$ project repo dr deep
=============== dr deep ===============
Contents:
.gitignore
Blood Cells
Breast Cancer
Heart Attack
LICENSE
README.md
Retinal OCT
Skin Cancer
Tuberculosis
samples
Branches:
master
Issues: 0
Private: False
Starts: 0
Forked False
Forks: 0
Watchers: 0
Language: Python
Owner: braindotai
URL: https://github.com/braindotai/Dr-Deep
SSH URL: git@github.com:braindotai/Dr-Deep.git
=======================================
To list all repositories
project repo list
Example:
$ project repo list
1. Custom-Linux-Command-Creator
2. Deep-Learning-Scratch-Arena
3. Dr-Deep
4. Dxeon
5. incubator-mxnet
6. Kaggle-Exploratory-Data-Analysis
7. KDD18-Gluon
8. MXNet-Gluon-Tutorials
9. pandas-videos
10. reinforcement-learning
11. Reinforcement-Learning-Scratch-Arena
12. Shell-Python-Project-Automation
To delete a repository
project repo delete <repository name>
Example:
$ project repo delete new project
Repository "new project" is deleted successfully
To create a backup of a project
project backup <project name>
Example:
$ project backup shell python project automation
Project "shell python project automation" is backuped successfully
For help you can run
project help