Supported Backends

All backends inherit from the following metaclass

class happi.backends.core.Backend

Abstract interface for backend database

delete(_id)

Delete a device instance from the database

Parameters:_id (str) – ID of device
Raises:PermissionError: – If the write operation fails due to issues with permissions
devices

List of all device sub-dictionaries

find(multiples=False, **kwargs)

Find an instance or instances that matches the search criteria

Parameters:
  • multiples (bool) – Find a single result or all results matching the provided information
  • kwargs – Requested information
save(_id, post, insert=True)

Save information to the database

Parameters:
  • _id (str) – ID of device
  • post (dict) – Information to place in database
  • insert (bool, optional) – Whether or not this a new device to the database
Raises:
  • DuplicateError: – If insert is True, but there is already a device with the provided _id
  • SearchError: – If insert is False, but there is no device with the provided _id
  • PermissionError: – If the write operation fails due to issues with permissions

Backend Choices

happi.backends.mongo_db.MongoBackend([host, …]) Abstraction for MongoDB backend
happi.backends.json_db.JSONBackend(path[, …]) JSON database
happi.backends.qs_db.QSBackend(run_no, …) Questionniare Backend