Skip to content

An alfred workflow to search for python packages in pypi and get the latest version number of a package.

Notifications You must be signed in to change notification settings

saeedesmaili/alfred-pypied

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pypied

An alfred workflow to search for Python packages in pypi and get the latest version number of a package.

demo

Requires

  • Python 3
  • Alfred Powerpack

Installation

Download the workflow here.

Usage

Fetch the list of packages

Since pypi doesn't provide an API to search for packages and it recommends using https://pypi.org/simple/ instead, this workflow fetches the list of Python packages when it's used for the first time (~22MB will be downloaded). This list gets stored as a JSON file in the workflow's directory and will be used to search for packages. To update this list you can use pypi-fetch keyword.

Search for packages

Use pypi <package-name> keyword (as shown in the demo above).

The first three results will have an up-to-date latest version and summary (fetched from pypi in real time). Other items in the list will only have the name (fetched from the local JSON file to prevent rate limit on pypi).

Copy the latest version to the clipboard

Hitting enter will copy the latest version number of the package to the clipboard (0.101.0 in the demo above).

Open the package page on pypi

Holding Option while hitting Enter will open the package's page on pypi in the default browser.

View a list of the latest versions of a package

Use pypi <package-name>/ to view a list of the latest versions of a package:

demo-releases

Hitting enter in this list will copy the version number to the clipboard.

TODO & Contribution

This is my first attempt to create an alfred workflow. Let me know in the issues of this repo if you have any solutions for the following TODO items, or if you can help with improving this workflow.

  • Display a fetching packages ... message when pypi-fetch keywords is used and the list is being downloaded.
  • Get the details of all packages in the search results in an efficient way (without requiring user to wait for the all requests to be finished and without rate limiting on pypi).
  • Display other details of the package (repo url, documentation url, etc).

About

An alfred workflow to search for python packages in pypi and get the latest version number of a package.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages