1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189# ppm โโ Python Package Manager
- Author: Jack Jiang
- Date: Jul. 2019
ppm allows you to manage python virtual environment packages as easy as using npm
ppm is just a wrapper of [python venv](https://docs.python.org/3/library/venv.html) module and [pip](https://pypi.org/project/pip/).
[](https://github.com/Jiangyiqun/ppm/stargazers)
[](https://github.com/Jiangyiqun/ppm/network)
[](https://github.com/Jiangyiqun/ppm/issues)
# Example
### Install Python virtual environment modules from package.txt
```python
python3 -m venv python_modules # create python environment
source ./python_modules/bin/activate # activate python environment
python3 -m pip install -r package.txt # install python modules from package.txt
deactivate # deactivate python environment
```
```shell
ppm install
```
### Install new Python virtual environment modules and save it to package.txt
```shell
python3 -m venv python_modules # create python environment
pip install new-package # install new-package
python -m pip freeze > package.txt # save new-package to package.txt
deactivate
```
```
ppm install new-package
```
### Run main.py with Python virtual environment modules
```shell
source ./python_modules/bin/activate # activate python environment
python main.py # run back-end server
deactivate # deactivate python environment
```
```
ppm start
```
# Setup
ppm file is self-contained, you only need one single file to run. However, I recommend you to clone the repository in order to get the update.
### Method 1: Add to $PATH
```shell
git clone https://github.com/Jiangyiqun/ppm.git && cd ppm && echo "export PATH=\"\$PATH:$(pwd)\"" >> ~/.bashrc && source ~/.bashrc
```
### Method 2: Symbolic link
```shell
git clone https://github.com/Jiangyiqun/ppm.git && cd ppm && sudo ln -s $(pwd)/ppm /usr/bin/ppm
```
To uninstall, just type
```shell
sudo rm /usr/bin/ppm
```
To uninstall, you need to manually remove the last line in `~/.bashrc`
# Commands




## Init
### `ppm init`

create python virtual environment in current directory
## Start
### `ppm start`

Start main.py in current directory
### `ppm start <py>`

start python file `<py>` in currrent directory
## Install (Alias: i)
### `ppm install`

Install Packages from package.txt
### `ppm install <pkg1> <pkg2> ... <pkgn>`

Install package `<pkg1> <pkg2> ... <pkgn>` and add to package.txt
## Uninstall
### `ppm uninstall <pkg1> <pkg2> ... <pkgn>`

Uninstall package `<pkg1> <pkg2> ... <pkgn>` and remove from package.txt
## list (Alias: ls)
### `ppm list`

Show installed packages
## Update
### `ppm update`

Update all installed packages and synchronize it with package.txt
### `ppm update <pkg1> <pkg2> ... <pkgn>`

Update package `<pkg1> <pkg2> ... <pkgn>` and synchronize it with package.txt
## list (Alias: ls)
### `ppm list`

Show installed packages
## Create Apps
### `ppm create-python-app <folder>`

create a hello world app in `<folder>`
### `ppm create-flask-app <folder>`

create a flask app in `<folder>`
# FAQ:
### 1. permission denied
```shell
chmod +x ppm
```
### 2. No module named venv / command not found: pip
Install either [Anaconda (Python 3)](https://www.anaconda.com/distribution/#download-section)
or [python venv](https://docs.python.org/3/library/venv.html) and [pip](https://pypi.org/project/pip/)
### 3. System Compatibility:
Does not support Windows