Skip to content

ThibautJacqmin/elabmate

Repository files navigation

elabmate

Python helpers to work with eLabFTW from Python and (optionally) sync Labmate acquisitions.

Features

  • ElabClient: high-level wrapper around the eLabFTW API client.
  • ElabExperiment: convenience helpers for tags, steps, comments, and uploads.
  • ElabBridge: optional Labmate backend to sync acquisitions with eLabFTW.

Installation

Editable install for local development:

python -m pip install -e .

Configuration

Create a configuration file (default: elabmate.conf) with one KEY=VALUE per line:

API_HOST_URL=https://elabftw_server_ip_address/api/v2
API_KEY= you API key, generated from the eLabFTW interface: Settings/API Key
UNIQUE_EXPERIMENTS_TITLES=true
VERIFY_SSL=false
TEAM_ID= check the team id (integer 1, 2, 3...) on eLabFTW interface: SysAdmin panel/TEAMS
LABMATE_DATA_DIR=optional, only if you use labmate

Notes:

  • TEAM_ID is optional; when absent, the client tries to resolve it from the API.
  • VERIFY_SSL accepts true or false, depending on how you configured the server

Quickstart

from elabmate import ElabClient

client = ElabClient()
exp = client.create_experiment(title="My experiment")

exp.main_text = "Experiment notes..."
exp.add_tag("demo")
exp.upload_file("path/to/file.dat")

Labmate integration

ElabBridge implements a Labmate acquisition backend interface. You can register it where Labmate expects a backend:

from elabmate import ElabBridge

backend = ElabBridge(client)
# Attach `backend` to your Labmate acquisition manager.

Tests

Run integration tests (requires a valid eLabFTW server/config):

python -m unittest discover -s tests -p "test_*.py"

References

About

ElabFTW Python helpers/Bridge between labmate and ElabFTW

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors