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
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
drs2-0.0.1.tar.gz
(8.8 kB
view details)
Built Distribution
drs2-0.0.1-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file drs2-0.0.1.tar.gz
.
File metadata
- Download URL: drs2-0.0.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ee970be0ce8f4a329ea881dac1e2b3a7a52dc2d9d9e82193a4e0f32d561fc6d |
|
MD5 | 9280cef36f45456a452e825998076c6e |
|
BLAKE2b-256 | 40ca0d9ffcadc0e82ba130169844364736c8b23f194f86cb6cfb259bca9cfcf7 |
File details
Details for the file drs2-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: drs2-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7135f5607d32304edfb45c3f93c229f7d7621f46a586835b9059bea59db353e |
|
MD5 | 8bc8ea0b8b571e39bd1ffc074e55d78b |
|
BLAKE2b-256 | 5300f51dd94f13cc70f726ae8d1306dc34361e78a89730773cafdd60d2f19417 |