Spiff Warehouse
----------------
This library is part of the Spiff platform.

Spiff Warehouse is a library for storing revisioned files in a database.


Contact
--------
Mailing List: http://groups.google.com/group/spiff-devel/


Dependencies
-------------
- sqlalchemy


Usage
------
See some example code below. API documentation is embedded into the
Spiff Warehouse source code and currently not yet available elsewhere.

##############################
import Warehouse

# Initialize
db = Warehouse.DB(...)
db.set_directory('data/')

# Add a revision of a file into the database.
item = Item("my/alias")
item.set_source_filename("my/test.txt")
assert db.add_file(item)
print "Added revision", item.get_revision()

# Add a new revision, but this time user a string instead of a file.
item.set_content("this is the new version of test.txt")
assert db.add_file(item)
print "Added revision", item.get_revision()

# Retrieve the latest revision.
item = db.get_file_from_alias("my/alias")
print "Latest revision is", item.get_revision()

# Retrieve all revisions.
items = db.get_file_list_from_alias("my/alias")
for item in items:
    print "Revision", item.get_revision()
##############################
