Many people have wished Python had a central package repository like CPAN for Perl, with an integrated downloader/installer. At the [December2005MeetingNotes December 2005] meeting, BrianRice presented SqueakMap, a package catalog for Squeak, which is a version of Smalltalk. The UI is a Squeak application that communicates with a central server. Packages are organized into categories, and you can search and install them from the application. What makes SqueakMap unusual is:
- Users are encouraged to enter package metadata early even if there's no code yet, and to upload code even if it's not ready for release. This makes it more of a collaboration tool that strictly a place for finished products. It also prevents abandoned packages from being lost, and facilitates their adoption by others. All code is marked alpha, beta, stable, etc. All versions of the package are accessible.
- Users can upload code or just give its URL. In the latter case, the central repository caches a copy in case the original disappears.
- The local application also caches a copy of interesting code.
Python's official package catalog is the Python Cheese Shop, also known as PyPI (Python Package Index). It has package metadata and standardized categories (based on TROVE). Recently it added a package upload feature.
EasyInstall is a new client program that parses the PyPI page for a certain package, downloads the package and installs it. It's bundled with Python Eggs and Setuptools, which is an enhancement to Python's distutils. An Egg is a file containing a package, metainformation, and list of dependencies. From the egg, EasyInstall can automatically fetch all required packages in one step. This is not a general package manager like RPM; it's solely for Python packages, including Python extensions written in C. Eggs are installed into Python's site-packages directory as directories or ZIP files. Because the egg is not a package (it *contains* a package), a line is added to site-packages/easy_install.pth to make Python add the egg to sys.path.
What Python can learn from SqueakMap is the collaborative value of announcing brand-new projects in a central searchable place, providing a way to archive unfinished or concept code, and using more caching in PyPI and EasyInstall to minimize the effects of server outage or authors deleting abandoned code. Complete caching may require a PyPI browsing program on the client side. However, some of these lessons may be unsuitable for Python. The large number of Python packages, users, and professional users makes one wonder if a catalog would be so overwhelmed as to be unusable if everybody put their half-baked ideas into it.
A year or two ago SeaPIG discussed the CPAN issue. BrianIngerson mentioned his Freepan project, a multilingual version of CPAN. It still exists but has never been heavily promoted or used, at least for Python. This may be due to the nature of several autonomous projects all working on the same problem, while the Perl and Squeak communities collaborated early on a single standard.