CLI wrapper for interacting with eLabFTW API at University of Duisburg-Essen
Project description
elabftw_ude_cli
elabftw_ude_cli is a Python-based CLI and importable API for interacting with the eLabFTW electronic lab notebook system, tailored for use at the University of Duisburg-Essen.
It provides:
- A command-line interface to create, modify, search, and read experiments.
- A Python API for programmatic integration with pipelines and notebooks.
- Tab-autocomplete support for fast CLI access.
- Optional integration with Python-based workflows like Snakemake.
🛠 Installation
pip install elabftw_ude_cli
🔑 Step 0: Add your API key and base URL
After installation, locate and edit your config.py:
elabftw-cli --config-path
Then open the file and update:
server_name_to_useto clarify which server to use- You can configure multiple servers and teams with different teams and/or test serversfor each server in the servers dictionary give it a name, and define its:
urlpointing to your institution's instanceapi_keywith your generated key (see below)
🎯 How to get your API key:
- Log in to eLabFTW.
- Click your initials in the top-right.
- Go to Settings → API Keys.
- Enter a name, set permission to read/write, and click Generate API Key.
- Copy and store the key safely – it will only be shown once.
⚡ CLI Usage
After installation, use elabftw-cli from the command line.
♻️ Enable tab-completion (Optional; Dose not work for conda based enviroenments)
activate-global-python-argcomplete --user
Or for bash/zsh:
eval "$(register-python-argcomplete elabftw-cli)"
📋 CLI Commands
elabftw-cli create_experiment --name "Exp Title" --body body.md --steps steps.json
elabftw-cli modify_experiment --exp_id 123 --body new_body.md --steps new_steps.json
elabftw-cli search_experiments --name-like "test"
elabftw-cli read_experiment --exp_id 123
📁 File Actions via CLI
elabftw-cli file-actions --name-like "My Experiment" --upload results.csv --replace
elabftw-cli file-actions --name-like "My Experiment" --search
elabftw-cli file-actions --name-like "My Experiment" --delete log.txt error.log
elabftw-cli file-actions --name-like "My Experiment" --download report.txt
File Options
--replace: Replace file if it already exists--delete: Delete files by name match (can be partial)--download: Download files totemp/directory--search: List uploaded files
🧑💻 Python API Usage
import elabftw_ude_cli.api as elf
# Create an experiment
exp_id = elf.create_experiment(
name="My Experiment",
body="<h1>Intro</h1><p>This is HTML</p>",
content_type=2
)
# Modify with body append and steps
elf.modify_experiment(
exp_id=exp_id,
body_append="Done.\nAll checked.",
steps=[{"body": "step_3: summary"}]
)
# Complete a step
elf.complete_step(exp_id, pattern="step_3", change="first", done_by="Alice")
# Search and read
ids, names = elf.search_experiments("test")
data = elf.read_experiment(exp_id=ids[0])
🧬 Snakemake Integration Example
See Snakemake Integration for examples of using this inside workflows.
📋 CLI auto_update and automations:
See Auto Update Guide for scheduling and automation.
📦 License
MIT License. See LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file elabftw_ude_cli-0.1.15.tar.gz.
File metadata
- Download URL: elabftw_ude_cli-0.1.15.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4867d274bb5a24a5a97fbe003b9b706c3261efbb8ca56abc2dbc05cc920d4d68
|
|
| MD5 |
7f4e457ef343a0c61a9bb0098e6d8393
|
|
| BLAKE2b-256 |
7bfac559360ce2eec4859f18189ad3f12ab72c617e0bb77e686a2eea666e01a0
|
File details
Details for the file elabftw_ude_cli-0.1.15-py3-none-any.whl.
File metadata
- Download URL: elabftw_ude_cli-0.1.15-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a9ac52e5b87a36c78d475f99aa5e96b705940d92f153a19f0750aabaa0e1f5b
|
|
| MD5 |
2b8e553e77d0e009382f94aa84bcab7b
|
|
| BLAKE2b-256 |
7d84cdb2ccc5bd61098bf70de6a4d71a5c6cd0a27a4036cbdc12771664cf0a28
|