How to submit you python package to PyPI

What is PyPi?

PyPI — the Python Package Index The Python Package Index is a repository of software for the Python programming language.

IF you are written something cool or simple app , and want to share it with other such a way that it can be easily installed by them. Then put your code in PyPi and then they can install you package simply by

pip install your-package  


Create Accounts :
  • Register at PyPI Live and also PyPI Test.
  • It will be easier if you use same credentials for both account.
  • If you have registered via OpenId or Google , remember to set the password after registration from the profile.

Create .pypirc config File
  • Create a .pypirc file in you home folder.

touch ~/.pypirc - Put bellow content on it,

  • Replace your_username and your_password with your pypi username and password.

Prepare Your Package

Now here is detail point of what you need,

  • Your package source will be on your_package directory.
  • docs folder will contain the documenation soruce for your package. You can make documentation with SPHINX and host it one READTHEDOCS
  • tests will contain the tests for your application
  • will contain the repository description in MARKDOWN format.
  • will contain the following settings,

    Add a .gitignore file with following contents


    Create a git tag

    git tag 0.1 -m "tags for first release"
    git push --tags origin master

    This will give you the download_url in Format is{username}/{module_name}/tarball/{tag}

    • setup.cfg will contain the location of README file,

      description-file =

Upload Your Package/ Release an update

    python register -r pypitest
    python sdist upload -r pypitest

    python register -r pypi
    python sdist upload -r pypi

You can check your package in PyPI Live and also PyPI Test.

N.B :

  • After uploading to test verify the content before uploading to live. You have to increase the version number each time you upload your package to PyPI.

References :