April 2, 2025

About

PyPI (Python Package Index) is the official repository where Python developers publish and share their packages with the world. If you’ve ever used pip install, you were downloading packages from PyPI.

Poetry is a modern Python packaging and dependency management tool that simplifies the entire process of creating a new package, managing dependencies, building the package, and publishing it to PyPI.

Upload Your Package to PyPi with Poetry

Register Your API Token in Poetry

You can store your api key in .config with below command.

poetry config pypi-token.pypi <your-api-token>

Update Version

If you execute below command, the version of your package will be automatically updated

poetry version patch

Build

poetry build

Publish (& build)

poetry publish --build
poetry publish

Check Your Package

https://pypi.org/project/your-package/

you can install your package with the command if you find it on the url

pip install your-package