Python Module creation
Creating a virtual environment :
python3 -m venv venv
Activation the vr. Environment:
source venv/bin/activate
Python setup.py sdist bdist_wheel
Generates 2 distributions :
. A sourced distribution which contains the files for us which is python
scripts
. The wheel distribution : contains binaries which are platform specific.
Contains all necessary files and dependencies to run the file
Means generates 2 folder : build and dist
In Dist folder we have a wheel file which is the actually file which we can share
with people and others can use our module through this
Local Testing
Done before actually pushing data on the actual open source file
Pip install dist/pyinspirationquotes-0.1-py3-none-any.whl
Pip list
– Your python package must be in the list
To create it as a command line interface or cli application
Now this package will directly run from command line
Add these in setup
entry_points={
'console_scripts': [
2
'pyinspirationalquotes=pyinspirationalquotes.main:hello',
],
1
},
PUBLISH TO PYPI
This is from where the pip gets its modules
Creating Inspirational Quotes Module
quotes.txt
rm -rf build/ dist/ pyinspirationquotes.egg-info
python setup.py sdist bdist_wheel
pip install --upgrade dist/pyinspirationquotes-1.0.0-py3-none-any.whl --force-
reinstall
twine upload dist/*
pypi-
AgEIcHlwaS5vcmcCJDQxNzk1MjQ3LTdjOTQtNDM5YS1iMTY0LWFhZmJmMTliM
DRhZAACKlszLCIwNDBiNjNjZi0yZjZmLTQxMjgtYjlhNi00MDUzYjNhMGU2MmQi
XQAABiCxZAfXJfoH6wsAMANH01JvUsXV_3ypmG4O4orzmoOZgQ
https://pypi.org/project/pyinspirationquotes/
https://pypi.org/project/pyinspirationquotes/
https://github.com/akankshasoni024/pyinspirationquotes.git