A high-level CLI for SLIMS REST API

https://img.shields.io/badge/license-apache2-brightgreen.svg https://img.shields.io/github/v/release/auwerxlab/slims-lisp-python-api https://img.shields.io/pypi/v/slims-lisp Documentation Status

Documentation

slims_lisp.slims CLI

slims-lisp

A high-level CLI for SLIMS REST API
slims-lisp [OPTIONS] COMMAND [ARGS]...
eln
CLI for the Electronic Lab Notebook (ELN)
slims-lisp eln [OPTIONS] COMMAND [ARGS]...
add-attachment
Upload a file to a an existing ELN experiment attachment step.

Return:

Returns the HTTP POST request response.

Example:

$ slims-lisp eln add-attachment –url <your_slims_url> –proj <your_project_name> –exp <your_experiment_name> –step <your_attachment_step_name> –file <path/to/your/file>

slims-lisp eln add-attachment [OPTIONS]

Options

--url <url>

SLIMS REST URL. ex: https://<your_slims_address>/rest/rest [required]

--proj <proj>

Project name (if any).

--exp <exp>

Experiment name. [required]

--step <step>

Experiment step name. [default: results; required]

--active <active>

Search only in active or inactive steps (or in both). [default: true]

Options

true|false|both

--file <file>

Path to the file that will be uploaded. [required]

--attm <attm>

A name to give to the attachement that will be created. [default: same as –file]

-v, --verbose

Print various messages.

-u, --username <username>

SLIMS user name. [required]

-p, --pwd <pwd>

SLIMS password. [required]

add-dataset
Create a new ELN experiment attachment step and upload multiple files to it (useful to upload a whole dataset containing multiple data and/or metadata files at once).

Return:

Returns HTTP POST requests responses in a dictionary.

Example:

$ slims-lisp eln add-dataset –url <your_slims_url> –proj <your_project_name> –exp <your_experiment_name> –files <file1>,<file2>,<file3> –title <your_dataset_name>

slims-lisp eln add-dataset [OPTIONS]

Options

--url <url>

SLIMS REST URL. ex: https://<your_slims_address>/rest/rest [required]

--proj <proj>

Project name (if any).

--exp <exp>

Experiment name. [required]

--files <files>

Comma-delimited paths to the files that will be uploaded. [required]

--title <title>

The title of the attachment block that will be created for the dataset in SLIMS. [default: dataset_<ISO 8601 timestamp>]

-v, --verbose

Print various messages.

-u, --username <username>

SLIMS user name. [required]

-p, --pwd <pwd>

SLIMS password. [required]

fetch-attachment
Download a file from an ELN experiment attachment step.

Return:

Returns the HTTP GET request response.

Output:

Generates two files (by default in the working directory):

-<output_dir>/<attm> The requested file

-<output_dir>/<attm>_metadata.txt Associated metadata in a JSON format

Example:

$ slims-lisp eln fetch-attachment –url <your_slims_url> –proj <your_project_name> –exp <your_experiment_name> –step <your_attachment_step_name> –attm <your_attachment_name>

slims-lisp eln fetch-attachment [OPTIONS]

Options

--url <url>

SLIMS REST URL (ex: https://<your_slims_address>/rest/rest). [required]

--proj <proj>

Project name (if any).

--exp <exp>

Experiment name. [required]

--step <step>

Experiment step name. [default: data_collection; required]

--active <active>

Search only in active or inactive steps (or in both). [default: true]

Options

true|false|both

--attm <attm>

Attachment name. [required]

--linked <linked>

Search only linked or unlinked attachments (or both). [default: true]

Options

true|false|both

--output_dir <output_dir>

Output directory [default: working directory].

-v, --verbose

Print various messages.

-u, --username <username>

SLIMS user name. [required]

-p, --pwd <pwd>

SLIMS password. [required]

slims_lisp.slims module

class slims_lisp.slims.Eln(url, username, pwd)[source]

Bases: slims_lisp.slims.Slims

create_attachment_step(proj, exp, title, verbose)[source]

Create a new attachment step in an experiment.

download_attachment(proj, exp, step, active, attm, linked, output_dir, verbose)[source]

Download a file from a SLIMS experiment attachment step.

get_attachment(linked, **kwargs)[source]
get_experiment(**kwargs)[source]
get_experiment_step(active, **kwargs)[source]
get_project(**kwargs)[source]
upload_attachment(proj, exp, step, active, file, attm, verbose)[source]

Upload a file to a an existing SLIMS experiment attachment step.

class slims_lisp.slims.Slims(url, username, pwd)[source]

Bases: object

get(table, **kwargs)[source]
post(table, **kwargs)[source]

SLIMS requirements

  • SLIMS version: >=6.1

Indices and tables