Interactive Shell

Interactive shell is a convenient Python REPL interface that allows you to manage, query and modify data in your DEKER™ storage.

Note

DEKER™ shell is based on amazing ptpython - a better Python REPL

Features

  • Autocompletion

  • Syntax highlighting

  • client and collections variables initialized at start

  • Shortcut use function to change current collection

  • Imported at start: numpy as np, datetime and all deker public classes

  • Running asyncio loop (thus, enabling you to use async and await)

  • All the ptpython features

Start

Once installed, open your terminal and run the shell providing path to DEKER™ storage via command line parameter (in this case it would be /tmp/deker-data):

deker file:///tmp/deker-data

Examples

Using global collection variable:

../_images/shell_collection.png

Creating a new collection:

../_images/shell_highlight.png

REPL menu (called with F2):

../_images/shell_menu.png

Interface

Imported DEKER™ Classes

Basic storage access and management classes:

Collection schema related:

Physical storage (HDF5) level options:

Preset Variables

  • client: Client (registry of collections) instance, connected to the uri-database

  • collections: list of Client collections names

  • collection: global default collection variable, set by use(“coll_name”) method;

  • np: numpy library

  • datetime: datetime library

Functions

  • use("collection_name"): gets collection from client and saves it to collection variable

  • get_global_coll_variable(): returns collection global variable

Miscellaneous

You can also run an isolated Python script with:

deker my_python_script.py