Version 40 (modified by Brian Warner, 11 years ago) (diff)

release 0.5.0


"Foolscap" is an RPC protocol for Python+Twisted, providing a capability-based security model and flexible serialization. It is intended to replace Twisted's native "Perspective Broker" RPC system. Foolscap has been under development (on and off) by Brian Warner for several years.

Download it here: foolscap-0.5.0 (gpg sig) or from its PyPI page.

It is released under the MIT license (see source:LICENSE for details), which is the same license as Twisted uses.


  • 18-Jan-2010: 0.5.0 released, "from foolscap.api import Tub", hush py2.6 "sets" warning, added git-furl examples
  • 19-Jun-2009: git-over-flappserver tools added to tree: use a FURL to update/pull from a remote Git repository
  • 16-Jun-2009: 0.4.2 released, with a new "application server", making it safe and easy to remotely run specific commands or move files into a specific directory
  • 13-May-2008: The recent Debian OpenSSL bug affects Foolscap: see DebianOpenSslBug for details.


The two primary responsibilities of an RPC protocol are to:

  1. serialize an object graph, and reconstruct a useful equivalent on the remote side
  2. allow the holder of a RemoteReference in one process to invoke methods on a Referenceable in a different one

In addition, there are details like object naming, connection establishment, controlling object serialization, reference lifetime, and error reporting.

Foolscap also provides a logging system which offers severity-triggered "Incident Reports" of the events leading up to a problem, which can be written to local disk or sent to a remote log gatherer. In addition, a log-retrieving tool can be attached to an application's "flogport" to retrieve recent events and subscribe to new ones.

FoolscapFeatures has a detailed list of features, including a description of the main differences between Foolscap and Perspective Broker.


Start with using-foolscap.html for a conceptual overview and basic tutorial.

There are other manuals here, including portions of the protocol specification. Detailed (but somewhat hard-to-navigate) API docs are located here.

The links above refer to the most recent Foolscap release. All documentation lives in the source tree's doc/ directory, so look there for the latest (not-yet-released) version.

Show Me The Code

Both current and older releases are available in the /releases directory. The latest code lives in a mercurial repository, at . To retrieve a copy of the trunk use the following command:

hg clone foolscap-trunk

There are two online source-code browsers, the native hgwebdir.cgi at (which also has a gitweb-style view), and the Trac Mercurial plugin at the Browse Source link above. Both are pretty handy.

Some day, Foolscap may be shipped as part of the "Twisted-Core" distribution, but only after the protocol and code have stabilized a bit.


The Foolscap wire protocol has been stable for about two years. There are changes and improvements I'd like to make to it, but they will probably be made in a compatible fashion. The protocol has several places for version negotiation, making this easier to achieve.

  • Foolscap takes many ideas from the E Language. Foolscap is my attempt to make the concepts of E available to python+twisted programmers.
  • The Twisted wiki has a page on Foolscap where this information used to live.

Projects Using Foolscap

  • Tahoe, a secure robust distributed filesystem, uses Foolscap for all inter-node communication
  • IPython, an "enhanced interactive Python shell, uses Foolscap for its parallel computing features
  • your name here! please add your own Foolscap-using project link here