Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to check if a PyPI package name is taken?

What is the best way to check if a PyPI package name is taken?

Several times now I have searched pypi for a package and received no results. Then I have taken the time to create a package with a name seemingly not taken, only to receive an error when I deploy. Is there a better way to check package name availability?

like image 397
Peter Cotton Avatar asked Sep 14 '25 00:09

Peter Cotton


1 Answers

Check the response of HTTP GET https://pypi.org/simple/{name}/. 404 means the name is available, contrary to HTTP GET https://pypi.org/project/{name}/ where 404 means either the name is available or there are no releases for this project.

You can do this from the browser, the response will show "404 Not Found" when the name is available or "Links for {name}" when the name is taken (even if there are no releases).

like image 155
pawamoy Avatar answered Sep 15 '25 13:09

pawamoy