Package sage :: Package misc :: Module db
[show private | hide private]
[frames | no frames]

Module sage.misc.db

Saving SAGE objects to a compressed database
Function Summary
  load(filename, bzip2, gzip)
load(filename): Loads an object from filename and returns it.
  load_db(x)
Load x from the database.
  path()
  save(x, filename, bzip2, gzip)
save(x, filename): Saves x to a file.
  save_db(x)
Save x to the database.

Variable Summary
str PATH = '/home/was/sage/db'
bool USE_DB = False

Function Details

load(filename, bzip2=False, gzip=False)

load(filename):

Loads an object from filename and returns it.  

INPUT:
   filename -- a string that defines a valid file.  If the
      file doesn't exist then an IOError exception is raised.

OUTPUT:
   An almost arbitrary object.

load_db(x)

Load x from the database. x must define a filename method.

save(x, filename, bzip2=False, gzip=False)

save(x, filename):

Saves x to a file.  Pretty much the only constraint on x is that
it have no circular references (it must be Python pickle-able).
This uses the pickle module, so data you save is *guaranteed*
to be readable by future versions of Python.

INPUT:
   x -- almost arbitrary object
   filename -- a string

OUTPUT:
   Creates a file named filename, from which the object x
   can be reconstructed.

save_db(x)

Save x to the database. x must define a filename method.

Variable Details

PATH

Type:
str
Value:
'/home/was/sage/db'                                                    

USE_DB

Type:
bool
Value:
False                                                                  

Generated by Epydoc 2.1 on Mon Jun 20 15:43:22 2005 http://epydoc.sf.net