shell#

Interactive shell helper for datakit.

Opens an embedded IPython (falling back to the stdlib code REPL) with a datakit object pre-loaded into the namespace. Shared by the mesofield datakit shell CLI command and python -m mesofield.datakit.

Depending on the target the shell is seeded with:

  • a directory -> dataset (a Dataset) plus its inventory and a report from explore()

  • a .pkl / .h5 file -> df (the materialized DataFrame loaded via load_dataset()) plus its report

  • nothing -> just the datakit package bound as datakit

mesofield.datakit.shell.build_namespace(target=None, *, hdf_key='dataset')[source]#

Build the (namespace, header) pair for an interactive datakit shell.

Parameters:
Return type:

tuple[dict[str, Any], str]

mesofield.datakit.shell.open_shell(target=None, *, hdf_key='dataset')[source]#

Open an interactive shell pre-loaded with a datakit object.

Returns a process exit code (0 on success).

Parameters:
Return type:

int