Python helpers to work with eLabFTW from Python and (optionally) sync Labmate acquisitions.
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.
Editable install for local development:
python -m pip install -e .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 labmateNotes:
TEAM_IDis optional; when absent, the client tries to resolve it from the API.VERIFY_SSLacceptstrueorfalse, depending on how you configured the server
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")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.Run integration tests (requires a valid eLabFTW server/config):
python -m unittest discover -s tests -p "test_*.py"- eLabFTW documentation: https://doc.elabftw.net/
- eLabFTW API docs: https://doc.elabftw.net/api/
- Labmate docs: https://kyrylo-gr.github.io/labmate/
- Labmate GitHub: https://github.com/kyrylo-gr/labmate