blog Add Urls to Python Projects

Tags:
packaging python uv

Python projects support a list of URLs when creating your pyproject.toml, however I often forget the specific categories. Similar to my add-classifiers project, I have created uvx add-url as a helper.

From the Python Packaging Guide there is a section on writing your pyproject.toml file with a section on urls . From the same heading, we see a note for Well-known labels .

The API I decided for this script is very simple.

uvx add-url https://example.com

By default, it will use the pzp library to provide a selector for which label you want to leave.

❯ uvx add-url example.com
  documentation
  releasenotes
  changelog
  download
  source
> homepage
  8/8
>

You can optionally also set it using --label.

While this project should stay very simple, the code is published on Codeberg.