Package Pyblio :: Module Store
[show private | hide private]
[frames | no frames]

Module Pyblio.Store

Overview

Contains the base classes and interfaces used to define a database of records.

The databases can be managed in different physical stores. To create a new database, get a specific store implementation with the get function, and call the provided dbcreate function:
>>> db = get ('file').dbcreate (path, schema)
Once this is done, the database is ready to accept records:
>>> record = Store.Record()
>>> record.add('title', u'my title', Attribute.Text)
>>> key = db.add(record)

See Also: the Database class to know what operations can be performed on databases.

Classes
Database A bibliographic database.
Key A key that uniquely identifies a record in a database.
Record A database record.
ResultSet A set of keys from the database.
ResultSetStore Interface to the stored result sets.
View A view of a Result Set represents the Result Set sorted according to a specific criterion.

Exceptions
StoreError Generic error occuring while accessing a database storage

Function Summary
  get(fmt)
Return the methods provided by a specific storage layer.
  modules()

Variable Summary
dict _cache = {}
str _dir = '/home/fred/devel/pyblio/1.3/Pyblio/Stores'
dict _modules = {'bsddb': 'bsddbstore', 'file': 'filestore', ...

Function Details

get(fmt)

Return the methods provided by a specific storage layer.

For instance:
>>> fmt = get ('file')
>>> db = fmt.dbopen (...)
The methods are:
  • dbcreate (file, schema): create a new database
  • dbopen (file): open a database in the specific store
  • dbimport (file): import an XML database into the specific store
  • dbdestroy (file): destroy a database
For more information, consult the documentation for the specific backends, Pyblio.Stores.filestore, Pyblio.Stores.bsddbstore and Pyblio.Stores.memorystore.

Variable Details

_cache

Type:
dict
Value:
{}                                                                     

_dir

Type:
str
Value:
'/home/fred/devel/pyblio/1.3/Pyblio/Stores'                            

_modules

Type:
dict
Value:
{'bsddb': 'bsddbstore', 'file': 'filestore', 'memory': 'memorystore'}  

Generated by Epydoc 2.1 on Sun Sep 24 23:52:44 2006 http://epydoc.sf.net