Last active
August 27, 2015 06:02
-
-
Save jackmaney/bb6b5432b7d663cdece6 to your computer and use it in GitHub Desktop.
A simple function to open the homepage of any project on PyPI (with a listed homepage)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Retrieves the home page of a project in PyPI, and opens that homepage in your default browser. | |
# This makes use of the PyPI JSON API: https://wiki.python.org/moin/PyPIJSON | |
function pypi_homepage() { curl -sL http://pypi.python.org/pypi/$1/json | \ | |
python -c "from __future__ import print_function;import json;import fileinput;\ | |
blob=json.loads(' '.join([x for x in fileinput.input()]));print(blob['info']['home_page'])"| xargs open ;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following variant works on Windows (via the Git Bash implementation of MINGW64):