Skip to content
tgmaxson edited this page Dec 1, 2014 · 3 revisions

TDB is designed to be used from a command line or from a script. To ease this, the default functions store a database at ~/.tmpdb.db which is considered to be the working database. This database is stored as an intermediate so that the path of the current database does not have to be repeatedly inputted / stored long term.


The following commands manipulate the database itself.

  1. tdb-load filename will load the database at filename into the working database. This will overwrite the working database, so save before calling this function.

  2. tdb-save filename will save the working database at filename. This does not remove the working database from being active. If you wish to work on another database either load a new one or clear it.

  3. tdb-clear filename will clear the working database by deleting it.


The following commands are designed to work with data in the database.

  1. tdb-add directory will add directory to the database if possible. The actual script called will determine if the directory can actually be added or not.

  2. tdb-add-dir directory [filter] will recursively add directory to the database if possible. All directories will be added to the database within directory in an attempt to find valid calculations. This works the same as piping a find command into tmb-add, more or less. If the filter parameter is included, any directories containing filter in their path will be skipped. This can be used to skip old/extended calculations if they are named in a way that allows them to be determined based on pathname.

  3. tdb-excel will use XLSXWriter to write a basic Output.xlsx file to the current directory. This file will be lack any real formatting and is mainly useful for extracting the data to another program / running through a script to format it.


The following commands are used to change the script used to import calculations.

  1. tdb-source-script scriptname is used to set the import script to one of the builtin scripts bundled with tdb. By default the script vasp-basic is used. The scriptname should not include the leading tdb-, but they are stored in the tools directory as such. To work this command MUST be run with source or with a leading . before tdb-source-script. This is required because it sets the environment variable TDB_IMPORT

  2. tdb-source-userscript scriptname is the same as tdb-source-script except that it requires an absolute path to the script. This can be used for custom scripts and/or bundled scripts, although the other function is significantly easier to use for the bundled scripts.


The following scripts are bundled with TDB.

  1. tdb-vasp-basic directory name.db is used for basic VASP calculations and is the script that tdb-excel currently supports properly. It can be called manually with the name of the database following it, but typically this script should be loaded into tdb with tdb-source-script like other bundled scripts. This is the default script loaded.

  2. tdb-vasp-slabfilm directory name.db is used for VASP calculations set up in a Slab+Film configuration. This is tailored to work with a specific type of system and is basically an extension of tdb-vasp-basic.

Clone this wiki locally