Skip to main content

No project description provided

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecl_api-0.0.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecl_api-0.0.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file ecl_api-0.0.2.tar.gz.

File metadata

  • Download URL: ecl_api-0.0.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for ecl_api-0.0.2.tar.gz
Algorithm Hash digest
SHA256 32ce94659672c16553ed71f2614da3cfe24b388ab4ed428d7283c47da900234f
MD5 8fb450d386f7e36361bcf6dcde9f8860
BLAKE2b-256 75a04f36a58333102d326d766ae9a8e19b675d1510558ed3e711590dce3794d6

See more details on using hashes here.

File details

Details for the file ecl_api-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ecl_api-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for ecl_api-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ef4f0c20b4682aa57d70310f5eeaca70d3a7e5ebfb788c73fb200810f7a2f0f3
MD5 a54a1fe92158de683e426447c3be34eb
BLAKE2b-256 6de59285efcaa07cb27a3471eb58779d1bde916ebf5aaa5c3a6d29c3964b9047

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page