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

Module Store

source code

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 [hide private]
  StoreError
Generic error occuring while accessing a database storage
  Key
A key that uniquely identifies a record in a database.
  Record
A database record.
  View
A view of a Result Set represents the Result Set sorted according to a specific criterion.
  ResultSet
A set of keys from the database.
  ResultSetStore
Interface to the stored result sets.
  Database
A bibliographic database.
Functions [hide private]
 
get(fmt)
Return the methods provided by a specific storage layer.
source code
 
modules() source code
Variables [hide private]
  _dir = '/home/fred/devel/pyblio/1.3/core/Pyblio/Stores'
  _modules = {'bsddb': 'bsddbstore', 'file': 'filestore', 'memor...
  _cache = {}
  ext = '.pyc'
  full = '/home/fred/devel/pyblio/1.3/core/Pyblio/Stores/__init_...
  m = '__init__'
Function Details [hide private]

get(fmt)

source code 

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.

Variables Details [hide private]

_modules

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

full

Value:
'/home/fred/devel/pyblio/1.3/core/Pyblio/Stores/__init__.pyc'