Phillip J. Eby wrote:
The PackageFinder.obtain() method would go to the PyPI base URL followed by the desired distribution name, e.g. 'http://www.python.org/pypi/SQLObject', and then scrape the page to see if it is a multi-version page, or a single-version page. If it's multi-version, it would scrape the version links and select the highest-numbered version that meets all of your criteria.
Really this would be very easy to add to PyPI as a set of xml-rpc calls, once the server move gets resolved. I could develop it now, except that the last pypi database dump I have is from before the move to Postgres, and there've been a number of changes since then, and I'd like some test data. I also have a checkout from CVS, but the SF project no longer lists CVS and svn.python.org doesn't have public access yet, so I can't point you to the code. But anyway, if someone on the new or old server can just run pg_dump on that database and email me the results (or a url to those results) that would be very helpful. Getting the data without screenscraping won't instantly give us all the necessary information. But it does contain good information about available versions, what the active version is, and per-version download URLs (which, if nothing else, could be compared against each other to detect non-version-specific URLs).
Hm. You know, what if as an interim step we had the command-line tool just launch a webbrowser pointing you to PyPI? Getting to a page for a suitable version is easy, so we could then let the user find the right download URL and then go back to paste it on the command line. That could be a nice interim addition, although it isn't much of a solution for packages with a lot of un-installed dependencies. You'd keep getting kicked back to the web browser a lot, and more to the point you'd have to keep restarting the tool. So, ultimately we really need a way to actually find the URLs.
That's not a very satisfying experience -- the person might as well just download the file at that point. Even with accurate data from PyPI, it's still likely there will be multiple possible URLs. At that point, at least if you are going through the command line, displaying all the URLs (numbered) and asking the user would probably give the user enough information to choose. -- Ian Bicking / ianb@colorstudy.com / http://blog.ianbicking.org