ZS3 is a Common Lisp library for working with Amazon S3

« previous entry | next entry »
Sep. 27th, 2008 | 09:09 pm

I've just published ZS3, a Common Lisp library for working with Amazon S3. I wrote it to support the Alzheimer's Art Quilt Initiative virtual patch generator, which stores the patches on S3.

I first tried using CL-S3, but I couldn't get it working on SBCL for binary file uploads. There were some workarounds possible, but it seemed like starting from scratch might work better for me.

ZS3 has been tested and works fine on SBCL, Clozure CL, Allegro CL, and LispWorks CL. It doesn't work on CLISP due to a Gray stream issue; I haven't been able to figure out the problem. CLISP debuggers welcome! I haven't tested it on other Common Lisps, so I'd love to hear if it works or doesn't work elsewhere. Update The patch linked here does the trick on CLISP.

It should install fine with asdf-install. It's also available from git.xach.com.

To give you a general idea of what it can do, here's the defpackage form:

(defpackage #:zs3
  (:use #:cl)
  ;; Credentials
  (:export #:*credentials*
           #:access-key
           #:secret-key
           #:file-credentials)
  ;; Buckets
  (:export #:all-buckets
           #:creation-date
           #:name
           #:all-keys
           #:bucket-exists-p
           #:create-bucket
           #:delete-bucket
           #:bucket-location)
  ;; Bucket queries
  (:export #:query-bucket
           #:continue-bucket-query
           #:bucket-name
           #:keys
           #:common-prefixes
           #:prefix
           #:marker
           #:delimiter
           #:truncatedp
           #:last-modified
           #:etag
           #:size
           #:owner)
  ;; Objects
  (:export #:get-object
           #:get-vector
           #:get-string
           #:get-file
           #:put-object
           #:put-vector
           #:put-string
           #:put-file
           #:copy-object
           #:delete-object
           #:delete-objects
           #:delete-all-objects
           #:object-metadata)
  ;; Access Control
  (:export #:get-acl
           #:put-acl
           #:grant
           #:acl-eqv
           #:*all-users*
           #:*aws-users*
           #:*log-delivery*
           #:acl-email
           #:acl-person
           #:me
           #:make-public
           #:make-private)
  ;; Logging
  (:export #:enable-logging-to
           #:disable-logging-to
           #:enable-logging
           #:disable-logging
           #:logging-setup)
  ;; Misc.
  (:export #:*use-ssl*
           #:make-post-policy
           #:head
           #:authorized-url
           #:resource-url)
  ;; Util
  (:export #:octet-vector
           #:now+
           #:now-
           #:file-etag
           #:parameters-alist
           #:clear-redirects)
  (:shadow #:method))

For the full scoop, check out the full documentation.

This would have been much more difficult to write, portably, without the great (and portable) libraries Drakma, Closure XML, and Ironclad.

Tags:

Link | Leave a comment | Add to Memories | Tell a Friend

Comments {3}

(:export {symbol-name}*)*

from: [info]http://openid.aol.com/YeshuaAaron
date: Sep. 28th, 2008 01:59 am (UTC)
Link

I never knew that multiple :export clauses were allowed, but I like this usage. This will probably work its way into my defpackages now.

Reply | Thread

(no subject)

from: [info]avodonosov.blogspot.com
date: Sep. 28th, 2008 10:08 pm (UTC)
Link

Maybe this patch will help to fix the gray-streams related error in CLISP: http://common-lisp.net/pipermail/cl-plus-ssl-devel/2008-June/000061.html.

(I do not have an S3 account, so I have not tested it).

Reply | Thread

Zach Beane

(no subject)

from: [info]xach
date: Sep. 29th, 2008 12:19 am (UTC)
Link

Works great, thanks for the pointer! I hope it gets rolled into a released version of trivial-gray-streams.

Reply | Parent | Thread