Convenient uploading of a project to PyPI using a bash alias

Earlier I thought that using pypandoc in your was a great idea to solve the long_description and the README.rst, when you write your README in Markdown. Spoiler: it’s a pretty terrible idea…


  • I have my README files in Markdown
  • I would like to have them also in reStructuredText for PyPI submission
  • I don’t want to copy paste and edit those files
  • I want to fill in the long_description in when uploading projects to PyPI

So the new solution is a bash alias:

alias pypush='rm -r dist/ *.egg-info/ ; pandoc --from=markdown --to=rst --output=README.rst && python sdist && twine upload dist/*'


This appears to solve the problems listed above.
It starts with clearing up the directory from the previous ‘upload’, then executes pandoc for conversion of the to README.rst (which I also added to my .gitignore), followed by creating the source distribution and uploading of the package. My (see below) opens the README.rst to get the long_description which is shown on the PyPI webpage.

Getting quite efficient here!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s