No project description provided
Project description
ecl-api
The Electronic Collaboration Logbook (ECL) is an e-logbook used at FNAL. This package allows retrieving and posting entries via Python using the ECL XML/REST API.
Table of Contents
Installation
pip install ecl-api
Usage
Start a connection with the ECL:
from ecl_api import ECL, ECLEntry
password = "your_ecl_pwd"
url = "your_ecl_link" # e.g. 'https://dbweb9.fnal.gov:8443/ECL/sbnd/E'
ecl = ECL(url=url, user='sbndprm', password=password)
Post a generic entry:
entry = ECLEntry(category='Purity Monitors', text='Example text', preformatted=True)
entry.add_image(name='Image Name', filename='/path/to/image.png')
ecl.post(entry, do_post=False)
Post a form:
entry = ECLEntry(category='Shift', formname='Shift run start checklist - v1')
form = {
"Maximize the window": "Yes",
"Date": "07/23/24",
"Time": "19:39:58",
"Run number": "00000",
"DAQ Components": "testentry",
"Configuration": "testentry"
}
entry.set_form_elements(form)
print(entry.show(pretty=True))
ecl.post(entry, do_post=False)
Retrieve an entry
ecl.get_entry(entry_id=7252)
Retrieve the last N entries in a certain category
text = ecl.search(category='Shift', limit=3)
Unpack content of text:
import xml.etree.ElementTree as ET
xml = ET.fromstring(text)
entries = xml.findall('./entry')
for entry in entries:
print(entry.attrib, entry.tag)
...
License
ecl-api is distributed under the terms of the MIT license.
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 ecl_api-0.0.3.tar.gz.
File metadata
- Download URL: ecl_api-0.0.3.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.12.3 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d23620a4116a4e57d3f20e2cb72fe23209fef8c174203f305fd191841362b651
|
|
| MD5 |
20fb98505475fcd26cae73602f94807c
|
|
| BLAKE2b-256 |
073854c9eb4de64aa9b1628b2532cb82f85b336e89a627fed4bb1b4ffb471265
|
File details
Details for the file ecl_api-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ecl_api-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.12.3 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aecf434ed3226351279b86b4222618e4f6f0755ddcdf82895f8a820f5502773
|
|
| MD5 |
724f9d78929dee2a6ac1c9f4a17faa6a
|
|
| BLAKE2b-256 |
37f35d03bbee44492b975567e5bb5a3c0d6e221a58c74b04af761c0c6ddfbaf0
|