Creating a python package that can run directly from terminal

Pranav Bhatia
Aug 11, 2021

--

Creating a simple package that can be used directly from the terminal without importing it into a python file. This one uses an open source API to create random insults. More informtion on the API here

Step 1: Setup your folder structure

Refer the following GitHub link to download the repository — https://github.com/prav10194/pypi-run-directly-from-terminal

Step 2: Building your package

In your folder, run the command on your terminal —

python setup.py sdist bdist_wheel
twine upload dist/*

Run the following command (in some other directory preferably) —

pip3 install evil_insult==0.0.1
python3 -m evil_insult

You can see the following printed on your terminal —

The article can help you create python applications that can be integrated directly into CI/CD pipelines (or some other use case). If you face any questions, I would be happy to help.

--

--

No responses yet