Skip to main content

ecl-api

PyPI - Version PyPI - Python Version pylint


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.

Metadata

Release files for ecl-api 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecl-api 0.0.3
File Size Uploaded
ecl_api-0.0.3.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecl-api 0.0.3
File Interpreter ABI Platform
ecl_api-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 20.5 kB

Release files / ecl_api-0.0.3.tar.gz

Download URL ecl_api-0.0.3.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d23620a4116a4e57d3f20e2cb72fe23209fef8c174203f305fd191841362b651
BLAKE2b-256 checksum
How to use checksums
073854c9eb4de64aa9b1628b2532cb82f85b336e89a627fed4bb1b4ffb471265
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.12.3 HTTPX/0.28.1

Release files / ecl_api-0.0.3-py3-none-any.whl

Download URL ecl_api-0.0.3-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9aecf434ed3226351279b86b4222618e4f6f0755ddcdf82895f8a820f5502773
BLAKE2b-256 checksum
How to use checksums
37f35d03bbee44492b975567e5bb5a3c0d6e221a58c74b04af761c0c6ddfbaf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.3 cpython/3.12.3 HTTPX/0.28.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page