Create Package - RecycleAI/RecycleIT-A GitHub Wiki

In this section we will learn how to build your first pypi package

Build your pypi package

  1. Create a package

    • Prepare your code to share
    • Create the init.py file
  2. Create the License and README files

    • License.txt will tell users the terms and conditions under which they can use your package. Go to and copy and past into your file the MIT license

    • README.md will simply tell users what your package is

  3. Create setup.py file

  4. Install the required packages with pip or pip3

    • Setuptools : Setuptools is a package development process library designed for creating and distributing Python packages.

    • Twine : The Twine package provides a secure, authenticated, and verified connection between your system and PyPi over HTTPS

  5. Run the command to generate your source distribution :

python setup.py sdist bdist_wheel

image

  1. Register yourself

https://pypi.org/account/register

  1. Run the command to upload package :

twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

  1. Test the package

pip install packagename