class Base.DataBase: self.key self.id def __init__ (self, url): def has_property (self, prop): def add (self, entry): def keys (self): return list (Keys) def has_key (self, key): return boolean def __getitem__ (self, key): def __setitem__ (self, key, value): def get_native (self, key): def set_native (self, value): def __delitem__ (self, key): def __len__ (self): return integer def iterator (self): return Iterator () def update (self):
This class provides access to a full bibliographic database. It basically behaves like a dictionnary: given the key of a entry, this object returns the entry itself.
Warning |
The database does not ensure that modifying the returned entry actually modifies the database. It does not ensure the opposite too. So, to commit changes, explicitely set the modified entry in the database. And to avoid unexpected modifications, explicitely copy an entry that has to be modified. |
The database is constructed from a URL object. Usually, the invocation of the constructor is not done directly by the user but rather through a higher level function like bibopen.
This method inserts a new entry in the database. If the entry has no key yet, a unique key is generated.
entry = database [key]
Returns an entry according to its key, like a dictionnary.
database [key] = entry
Stores an entry under a given key in a database.