Difference between revisions of "Mulib"

From Second Life Wiki
Jump to: navigation, search
(Releases: Trac allows us to pick the HEAD revision for zip file generation, so this is more future-proof. Heck yeah!)
(Releases: OK, no more HEAD business, just the link from the Trac page. We need a better archive solution anyway, no need to keep polishing this.)
Line 15: Line 15:
| '''Name''' || '''Date''' || '''Zip''' || '''SVN'''  
| '''Name''' || '''Date''' || '''Zip''' || '''SVN'''  
| beta-1 || Aug 24, 2007 || [http://svn.secondlife.com/trac/mulib/changeset/HEAD/branches/beta-1?format=zip] || [http://svn.secondlife.com/svn/mulib/branches/beta-1]
| beta-1 || Aug 24, 2007 || [http://svn.secondlife.com/trac/mulib/changeset/4/branches/beta-1?old_path=%2F&format=zip] || [http://svn.secondlife.com/svn/mulib/branches/beta-1]

Revision as of 21:47, 24 August 2007


Mulib is a REST web service framework built on top of eventlet.httpd. Httpd parses incoming HTTP request and generates the response; mulib takes care of locating the object which will handle the request (url traversal) and calling the appropriate callback method based on the method of the request. Code written using mulib looks like a series of subclasses of mu.Resource which override methods such as handle_get or handle_post, making it easy to implement web services.

The stacked traversal code also knows how to traverse python objects like dicts and lists. Using that style, it is possible to easily interact with compositional data structures through the Web.


Name Date Zip SVN
beta-1 Aug 24, 2007 [1] [2]


Mulib runs on Python version 2.3 or greater, with the following dependenceis:


Files called out in bold in this list have an accompanying unit test.

  • auth.py : Implementation of HTTP basic authentication.
  • cgiadapter.py : Adapter that makes it possible to interact with a mu application as a cgi.
  • console.py : Multi-user browser-based console that manipulates/inspects the running state of the application.
  • eventrouter.py : Eventrouter is a generic browser/server message-passing framework. It's used to build many of the neat little web apps included in mulib.
  • htmlexception.py : Formatting code to render python exceptions (and stack traces) to html.
  • logconsole.py : Eventrouter console for programs to log to.
  • mu.py : Exposes the most important apis from mulib, such as mu.Resource, the
  • nodes.py : Implementation of generic http-based publish/subscribe. It's at the proof-of-concept stage.
  • shaped.py : A system for meta-description of python objects, using python objects. E.g. a list of ints [1, 2, 3] has the shape [int]. Also at the proof-of-concept stage.
  • resources.py : Assorted useful subclasses of mu.Resource.
  • shellconsole.py : Interactive python shell in a browser, implemented with eventrouter. Allows you to poke and prod at your application's state as it's running.
  • sourceconsole.py : Interactive source code browser for eventrouter. It's been a long time since anyone has looked at this code, it probably needs some freshening up.
  • stacked.py : Recursive url-based traversal of Python data structures. The various consume methods match up path segments from a url with a hierarchical data structure. The produce methods convert data for transport over the wire. The names of these methods are somewhat confusing, we could use some better ones.
  • testconsole.py : Unit test running and reporting application built with eventrouter.
  • tests.py : A place to keep test utilities. Lightly used, but it will become more useful as test coverage grows.
  • virtual.py : Virtual host implementation (i.e. dispatching based on the Host header).


  • Mulib can expose native python objects via a RESTful interface, but it doesn't yet have any inbuilt access control, so being able to read the objects also means being able to write or delete them. However, this is only a problem if you choose to expose your objects in this way.