Packaging your Python library has never been easier now using Poetry. You may have a side project in Python that benefits others. You can publish it using Poetry. This post will show you how to build your own Python library and publish it on the most popular Python package repository PyPI.

I will use one of my recent Python projects, PyPocket: a Python library (wrapper) for Pocket (previously known as Read It Later).

Prerequisite

1. Project environment

You need to have your project environment managed in Poetry since we will be using the pyproject.toml file to build our package and publish it.

You can check my post on how to set up your Python environment using Conda and Poetry. If you are not using Conda, you can follow the steps I provided in the post but instead use other environment management systems like Pipenv or Virtualenv.

2. Package repository

We will need a package repository to host the Python package; the most popular one is PyPI. So, if you want to publish your library on PyPI, you need to first create an account on PyPI.

#packaging #python

How to Publish Your Python Package with Just 2 Commands
4.50 GEEK