I have created a module using python. I want to publish it to pip and PyPi so that others can download and use it easily. How do I do it?
The answer can be easily found on the Internet. I just referenced this site to answer you. You can follow the steps below:
create an account on PyPi
.
Create a README.md
file as an instruction for users (Highly recommended).
Create a setup.cfg
file, and write the following content:
[metadata]
description-file = README.md
Create a LICENSE
file by referencing this website.
As @Yang HG mentioned, write a setup.py
file, followed by running python setup.py sdist
.
Upload your distribution by using twine
. First, you need to pip install twine
, then run twine upload dist/*
.
Finally, your distribution can be viewed on https://pypi.org/project/YOURPACKAGENAME/