Skip to main content


Project description

Cheese Prism

A simple application for managing a static python package index. It
borrows heavily from `BasketWeaver <>`_
and `cheese_emporium <>`_. It
leverages `pip <>`_ and setuptools/`distribute <>`_
for various package management tasks.




Activate your virtual env. Then either check out the code to your chosen location::

$ git clone git://

and install::

$ cd CheesePrism; pip install -e ./

or use pip to clone and install directly to ``$VIRTUAL_ENV/src``::

$ pip install git+git://
$ cd $VIRTUAL_ENV/src/cheeseprism


To run the tests, first install the test requirements::

$ cd CheesePrism
$ pip install -r tests-require.txt


$ nosetests -vv

This will run tests and spit out coverage.


The following will start the application and a static file server for
`CheesePrism` suitable for testing and development::

$ paster serve development.ini

To run the tests::

$ pip install -r tests-require.txt
$ nosetests -vv


``CheesePrism`` doesn't pretend that it or python servers in general
excel at serving flat files.

For a more durable and performantized setup, you will want to split the
serving between a wsgi host for the management application and a
industrial strength file server (say nginx).

Configure Nginx

See ``doc/sample-nginx.conf`` and replace ``alias CheesePrism/files;`` and
``alias CheesePrism/static`` with your fileroot and static filepath.

.. todo::

have start up announce static and file_root (and document)

Serve management app

Use the prod.ini (edited for your setup) for simplest serving::

$ paster serve prod.ini

Sane people use something like upstart or `supervisord <>`_ to manage this process.

.. todo:
ini config generation script

How to use

Release into your index

CheesePrism understand the upload interface of pypi. This means for
python2.6 and better you can setup your ``~/.pypirc`` and then upload to
your prism as you would `pypi <>`_::

index-servers =


# your prism of fromage

The you can upload a source ala::

$ cd /src/MyAwesomePyPkg
$ python sdist upload -r local

**Note**: The prism currently has the *most* basic support for pypi's
basic auth scheme. This mainly exists for the purpose of grabbing the
identity of who puports to be uploading a package, rather than any
actual security. If you need more, it should provide a starting point
for extension (see `pyramid documentation <>`_
for more information on extending pyramid apps).

Install from your index

**Now** your package is available for install from your prism::

$ pip install -i http://mycheese/index/ MyAwesomePyPkg

All dependencies of ``MyAwesomePyPkg`` will also come from your prism,
so make sure they are there (coming feature will inspect your release
and do the needful).

Populate your index with your dependencies

There are 3 main ways to load files:

1. If you put archives into the file root of your index and restart
the app, it will generate index entries for them. There are plans
to make this automagical soon so a restart is not required.

2. Through the 'Load Requirements' page you may upload a pip
requirements files that CheesePrism will use to populate your
index. Easiest way to create a pip requirements file for a

$ pip freeze -l > myawesomerequirement.txt

3. Use the "Find Package" page to search pypi and load packages into
the index. Currently this utilizes some state change on GET but
does remain idempotent (to be fixed soon).


There is also rudimentary read only json api::

$ curl GET http://mycheese/index/index.json

The resulting json is a hash of objects keyed by md5 hashes of each
archive. Let's imagine our index only holds webob::

{u'1b6795baf23f6c1553186a0a8b1a2621':{u'added': 1325609450.792506,
u'filename': u'',
u'name': u'WebOb',
u'version': u'1.2b2'}}


Files may be added to the index from pypi via a not so RESTful interface
that will soon go away. Provided ``name`` and ``version`` exist in PyPi, the
following will download the file from pypi and register it with the index::

$ curl GET http://mycheese/package/{name}/{version}


Some features we plan to implement in the near future:

* **Multi-index support**: The general idea is that you can evolve
indexes rather like requirements files but by explicit limiting of
membership in a group rather than specification that requires
talking to an external index. One archive might exist in multiple
indexes (but always serve from same location to preserve pip

This would include a ui for select member archives to compose an new index as
well as cloning and extending an existing index.

* **Less crap work**: automatic dependency loading for releases and
packages loaded via find packages. A file watcher for the repo that
rebuilds the appropriate parts of the index when files are added
and removed.

* **Better readonly api**: versions.json for each package with the data
in index.json provided in a more easily consumable fashion.

* **Better REST**: Make ``POST /packages/{name}/{version}`` to grab a package from PyPi. Make ``GET /packages/{name}/{version}``
provide data about the package and indicate whether the package current lives in index or not.

* **Proper sphinx documentation**: yup.

Wanna get involved?

Pull requests welcome! I'm on freenode at *#pyramid* or *#surveymonkey*
as ``whit`` most days if you have questions or comments.


Initial alpha release.

Development Log

2012-01-09 whit <>:
* Recursive download of requirements files and dependencies
* Search of pypi and download of files
* Improved test coverage
* Initialization of index on start up
* Basic read-only API for index
* Broader event support
* Documentation improvements

2011-12-21 whit <>:
* Individual leaf update via event on upload
* Refactor to use pkginfo

2011-12-01 whit <>:
* Housekeeping: add static fileserving for index for developments,
more use of
* Port over emporium readme.

2011-11-07 whit <>:
* Get app basically serving

2011-11-07 whit <>:
* Setup initial package structure

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
CheesePrism-0.1a1.tar.gz (88.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page