Skip to main content

Module for drs2 db calls

Project description

drs2

Module for drs2 db calls
This a wrapper for drs2 sql calls that:

  • retrieves object ids. get_object_ids(file_ids)
  • updates the DRS_OBJECT_UPDATE_STATUS table. update_object_ids()
  • retrieves descriptor paths get_descriptor_path(object_id)
  • checks to see if an object is in the update queue. check_object_in_update_queue(object_id)

Using the module

import drs2
from dotenv import load_dotenv
from drs2.drsdb import DrsDB
from drs2 import configure_logger

load_dotenv()
configure_logger()
logger = logging.getLogger('drs2_judaica_update')

drs_db = DrsDB()
object_id = "12345678"
if drs_db.check_object_in_update_queue(object_id):
    logger.error(f"Object id {object_id} is in update queue")
else:
    logger.info(f"Object id {object_id} is NOT in update queue")

ocfl_path, storage_class = drs_db.get_descriptor_path(object_id)
logger.info(f"{ocfl_path}, {storage_class}")

Dependencies

  • Required modules are listed in requirements.txt.

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

drs2-0.0.1.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

drs2-0.0.1-py3-none-any.whl (12.0 kB view hashes)

Uploaded Python 3

Supported by

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