Interface for a generic database.
A typical database can be used to retrieve molecules by calling the get method:
water = db.get("molecule", "example.water")
A database can also provide custom functionalities to store or search for entries. Those are implemented in custom methods.
See the other implementations for more relevant examples.
Get a data entry from the database.
Subclasses are required to implement this method to provide access to the database.
Parameters
An identifier that represents the kind of data that we want to extract. Examples of such identifier are “system”, “molecule”, “data” etc.
The key associated with the database entry. By convention you can use dotted names to provide some kind of nested structure.
Custom extra arguments.
Chemlab default database.
This database contains some example molecules and some atomic data.
Retrieve a molecule from the database. The included molecule keys are:
Retrieve atomic data. The available data is:
Data was taken from the OpenBabel distribution.
Store serialized molecules and systems in a directory tree.
See Having your own molecular database for an example of usage.
Directory where the database is located.
Get an entry from the database. Key is the filename without extension of the serialized molecule. Molecules are stored in the subdirectory.
Get an entry from the database. Key is the filename without extension of the serialized system.
Store a Molecule or a System passed as value in the directory structure. The objects are dumped to disk after being serialized to json.