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. |
TxoGroup |
Definition of a group of Txo items. |
TxoStore |
This class is the interface via which Txo items can be
manipulated. |
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/infoscience/src/dependencies/py...
|
dict |
_modules = {'bsddb': 'bsddbstore', 'file': 'filestore', ...
|
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 .
-
|
_dir
-
- Type:
-
str
- Value:
'/home/fred/devel/infoscience/src/dependencies/pybliographer/pyblio/Py\
blio/Stores'
|
|
_modules
-
- Type:
-
dict
- Value:
{'bsddb': 'bsddbstore', 'file': 'filestore', 'memory': 'memorystore'}
|
|