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.
Metadata
Release files for drs2 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| drs2-0.0.1.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| drs2-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.7 kB
Release files / drs2-0.0.1.tar.gz
| Download URL | drs2-0.0.1.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ee970be0ce8f4a329ea881dac1e2b3a7a52dc2d9d9e82193a4e0f32d561fc6d
|
|
BLAKE2b-256 checksum How to use checksums |
40ca0d9ffcadc0e82ba130169844364736c8b23f194f86cb6cfb259bca9cfcf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.8
|
Release files / drs2-0.0.1-py3-none-any.whl
| Download URL | drs2-0.0.1-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7135f5607d32304edfb45c3f93c229f7d7621f46a586835b9059bea59db353e
|
|
BLAKE2b-256 checksum How to use checksums |
5300f51dd94f13cc70f726ae8d1306dc34361e78a89730773cafdd60d2f19417
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.8
|