Skip to main content

A high-level CLI for Slims REST API

Project description

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

Slims-lisp is a small python package that provides a CLI for Slims REST API.

Features:

  • Download a file from a slims experiment attachment step.
  • Upload a file to a slims experiment attachment step.

Installation

The latest release is available on PyPI and can be installed using pip:

$ pip install slims-lisp

Isolated environments using pipx

Install and execute slims-lisp in an isolated environment using pipx.

Install pipx and make sure that the $PATH is correctly configured.

$ python3 -m pip install --user pipx
$ pipx ensurepath

Once pipx is installed use following command to install slims-lisp.

$ pipx install slims-lisp
$ which slims-lisp
~/.local/bin/slims-lisp

Usage

slims-lisp fetch

Usage: slims-lisp fetch [OPTIONS]

  Download a file from a slims experiment attachment step.

Options:
  --url TEXT                  Slims REST URL. ex:
                              https://<your_slims_address>/rest/rest
                              [required]
  --proj TEXT                 Project name (if any).
  --exp TEXT                  Experiment name.  [required]
  --step TEXT                 Experiment step name.  [default:
                              data_collection; required]
  --active [true|false|both]  Search only in active or inactive steps (or in
                              both).  [default: true]
  --attm TEXT                 Attachment name.  [required]
  --linked [true|false|both]  Search only linked or unlinked attachments (or
                              both).  [default: true]
  --output TEXT               Output file name. [default: same as --attm]
  -u, --username TEXT         User name (prompted).  [required]
  -p, --pwd TEXT              Password (prompted).  [required]
  --help                      Show this message and exit.

Output:

  • Returns the HTTP GET request response.
  • Generates two files (by default in the working directory):
<your_working_directory>
|── <output>               The requested file
└── <output>_metadata.txt  Associated metadata in a JSON format

Example:

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

slims-lisp add

Usage: slims-lisp add [OPTIONS]

  Upload a file to a slims experiment attachment step.

Options:
  --url TEXT                  Slims REST URL. ex:
                              https://<your_slims_address>/rest/rest
                              [required]
  --proj TEXT                 Project name (if any).
  --exp TEXT                  Experiment name.  [required]
  --step TEXT                 Experiment step name.  [default: results;
                              required]
  --active [true|false|both]  Search only in active or inactive steps (or in
                              both).  [default: true]
  --file TEXT                 Path to the file that will be uploaded.
                              [required]
  --attm TEXT                 A name to give to the attachement that will be
                              created. [default: same as --file]
  -u, --username TEXT         User name (prompted).  [required]
  -p, --pwd TEXT              Password (prompted).  [required]
  --help                      Show this message and exit.

Output:

  • Returns the HTTP POST request response.

Example:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for slims-lisp, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size slims_lisp-0.1.0-py2-none-any.whl (7.8 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size slims-lisp-0.1.0.tar.gz (5.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page