The recordstore module provides an abstraction layer around storage of simulation/analysis records, providing a common interface to different storage methods (simple serialisation, relational database, etc.)
All record store classes have the following methods. Some stores have additional methods (see below).
Base class for record store implementations.
Delete the record with the given label from the given project.
Delete all records from the store.
Delete all records from the given project that have been tagged with the given tag.
Returns a string with a JSON representation of the project record store.
Returns a string with a JSON representation of the given records.
Retrieve the record with the given label from the given project.
Does the store contain any records for the given project?
Import records in JSON format.
Return the labels of all records in the given project.
Return a list of records for the given project.
If tags is not provided, list all records, otherwise list only records that have been tagged with one or more of the tags.
Return the names of all projects that have records in this store.
Return the most recent record from the given project.
Store the given record under the given project.
Synchronize two record stores so that they contain the same records for a given project.
Where the two stores have the same label (within a project) for different records, those records will not be synced. The method returns a list of non-synchronizable records (empty if the sync worked perfectly).
Synchronize all records from all projects between two record stores.
Modify the records for a given project.
Bases: sumatra.recordstore.base.RecordStore
Handles storage of simulation/analysis records based on the Python standard shelve module.
The advantage of this record store is that it has no dependencies. The disadvantages are that it allows only local access and does not support the smtweb interface.
Bases: sumatra.recordstore.base.RecordStore
Handles storage of simulation/analysis records in a relational database, via the Django object-relational mapper (ORM), which means that any database supported by Django could in principle be used, although for now we assume SQLite or PostgreSQL.
This record store is needed for the smtweb interface.
Bases: sumatra.recordstore.base.RecordStore
Handles storage of simulation/analysis records on a remote server using HTTP.
The server should support the following URL structure and HTTP methods:
/ | GET |
/<project_name>/[?tags=<tag1>,<tag2>,...] | GET |
/<project_name>/tag/<tag>/ | GET, DELETE |
/<project_name>/<record_label>/ | GET, PUT, DELETE |
and should both accept and return JSON-encoded data when the Accept header is “application/json”.
The required JSON structure can be seen in recordstore.serialization.
Create an empty project in the record store.
Return a project’s long name and description.
Update a project’s long name and description.
Return the RecordStore object found at the given URI (which may be a URL or filesystem path).
Handles serialization/deserialization of record store contents to/from JSON.
copyright: | Copyright 2006-2015 by the Sumatra team, see doc/authors.txt |
---|---|
license: | BSD 2-clause, see LICENSE for details. |
Encode a Sumatra project as JSON
Create a Sumatra record from a nested dictionary.
Create a Sumatra record from a JSON string.
Create multiple Sumatra records from a JSON string.