November 17th, 2006

Access Amazon S3 from CL

Sven Van C10e just released CL-S3, "a Common Lisp library to interface with the Amazon S3 Web service". Here's his announcement:

Today I published CL-S3, a Common Lisp library that implements a client interface to the Amazon S3 Web Service (see for more information).

More specifically, CL-S3 ( )

  • uses the Amazon S3 REST interface
  • does proper authorization
  • implements all S3 API calls with all options
  • parses the XML returned by some of the API
  • converts S3 error responses to proper Common Lisp condition objects
  • allows custom meta header (including canned access policies) and query parameters
  • does proper keep-alive processing (courtesy s-http-client)
  • is portable over Common Lisp implementations (courtesy s-sysdeps)
  • can optionally validate get and put object calls using MD5 hashing
  • contains 2 example higher level functions converting XML to simpler data
  • is properly packaged and has a documented public API
  • should be installed using ASDF
  • is less than 300 lines of code, comments included [but see below -zach]

You can download the code using the URL
or from S3 itself using the URL

CL-S3 is available under an LLGPL license.
The current release is available as a tarball only.



"Less than 300 lines" is a little misleading. Here's the :depends-on part of cl-s3.asd:

  :depends-on (:s-http-client 
               :kpax ;; this is actually overkill, but we need the crypto code and some utilities

On the other hand, it's nice that something useful like CL-S3 can be written concisely by accumulating functionality from existing libraries.