Currently, the goal is to create a simple tool to manage dependencies,
Initialize projects (django, fastapi, flask) with production ready features.
Initialize pytest, tox, GitHub actions etc. which takes a lot of time to configure. Managing scripts to run,
(Inspired by npm run
)
- Use pyproject.toml config
- Auto virtualenv generation
- Auto venv activation, no need to activate
venv
before runningscripts
- Auto manage dependencies in
pepsin.yaml
- Install and store libraries
- Run scripts stored in the configuration file
python 3.6+
$ pip3 install pepsin
pepsin generates or uses pepsin.yaml
file to store
all your metadata, project configuration, project libraries and dependencies
pepsin.yaml
config file
name: GameOfChairs # Name of the project
author: Khan Asfi Reza # Author's name
email: info@khanasfireza.com # Author's email
venv: venv # Virtualenv directory name
license: MIT # Project license type
libraries:
# Installed libraries
- django
- psycopg2
- djangorestframework
- django-channels
If any failure or error occurs a failed.pepsin.log
will be created mentioning the problem
$ pepsin init
Init command generates basic python project to get start with, It will interactively ask you to fill the required fields
$ pepsin init
$ pepsin Generate Project
$ ----------------------
$ Project Name[project]:
$ Author[]:
$ Email[]:
$ License[]:
File structure
Project Directory
|____ venv
|____ pepsin.yaml
|____ Readme.md
|____ .gitignore
|____ project
|___ main.py
|___ __init__.py
name
the name of the project and pepsin will create a project with the given project name
Example:
$ pepsin init project_name
option | description | type | required | default |
---|---|---|---|---|
--venv | Virtual environment directory | string | false | venv |
--h | Help text | boolean | false | |
--no-input | Ignores input prompt | boolean(flag) | false | venv |
Command Alias: add
i
Install required dependencies and libraries
$ pepsin install django
or
$ pepsin i django
or
$ pepsin add django
Also text
file with list of libraries can be installed with -r
flag
$ pepsin install -r requirements.txt
Note: install command will by default create a pepsin.yaml
file and a virtualenv directory named venv
option | description | type | required | default |
---|---|---|---|---|
-r | Install from the given requirements file | string | false | null |
--h | Help text | boolean | false |
Uninstall a library that is installed in your environment
$ pepsin uninstall <library>
Example:
$ pepsin uninstall flask
Uninstall command will remove the library from the virtual environment as well as the config
Alias: upgrade
Upgrades a library that is installed in your environment
$ pepsin upgrade <library>
Example:
$ pepsin upgrade flask
Command Alias: r
Runs a script from the pepsin.yaml
To store and run scripts you must write your scripts in the pepsin configuration
Example:
pepsin.yaml
name: example # Name of the project
author: Khan Asfi Reza # Author's name
email: info@khanasfireza.com # Author's email
venv: venv # Virtualenv directory name
license: MIT # Project license type
libraries:
# Installed libraries
- django
- psycopg2
scripts:
start: example/manage.py startserver
test: pytest
To run the start
script use pepsin run command
$ pepsin run start
or
$ pepsin r start
which will fire the start
script
You can add other cli commands as well
scripts:
migrate: django-admin makemigrations
$ pepsin run migrate
Run regular pip command
$ pepsin pip freeze
Pip will automatically use available virtual env (if available) otherwise it will use global pip