Creating your own modules
If you do not mind, please read this article on Medium.
In this lesson, you will learn how to create your own module and deploy it on PyPi so anyone can install and use it. First, make sure you have the pip
command added to PATH
as shown here.
- Create an account at PyPi.
- In the account settings, generate an API token and save it for later.
- Download all the necessary files from here. Customize the
setup.py
,README.rst
,MANIFEST.in
, andLICENSE.txt
files. Your classes go in the__init__.py
file. - Install the
setuptools
andtwine
modules using thepip install
command. - Go to the folder with customized files in CMD using the
cd
command. - Execute the following commands:
python setup.py sdist
,python -m twine upload dist/*
. The second command will ask you for authorization using the API token. After these commands finished executing, your module will be ready. - Install your module using the
pip install
command and enjoy! Its documentation (theREADME.rst
content) will be available on the PyPi website.