OAIS utilities
Project description
oais-utilities
Utilities to work with the CERN OAIS artifacts, such as Submission Information Packages.
Features
Validate CERN SIP
Validates the folder in the given path according to the CERN SIP specification, following these steps:
- Verify directory structure
- Validate the manifest file against the desired sip JSON schema. By default uses sip-schema-d1.json, also shipped in this package
- Validate the folder as a BagIt package
- file are allowed to be missing if the manifest specifies it's a "lightweight" SIP.
- Checks if every content file mentioned in the manifest is actually present in the payload
Usage:
from oais_utils import validate
validate("name_of_the_sip_folder")
sip.json schemas
SIP manifest JSON schemas are also shipped and exposed with this package.
To get a python dictionary with the schema short name as keys and the parsed (as python object) schema as value for the corresponding schema name, run:
import oais_utils
schemas = oais_utils.schemas
schemas.keys()
# ['draft1']
schemas['draft1']
# [...]
# (Returns the sip JSON schema "draft1" as parsed python object)
schemas['draft1']['$id']
# https://gitlab.cern.ch/digitalmemory/utils/-/raw/master/oais_utils/sip-schema-d1.json
Install
Install from PyPi
pip install oais-utils
For development, you can clone this repository and then install it with the -e
flag:
# Clone the repository
git clone https://gitlab.cern.ch/digitalmemory/oais-utils
cd oais-utils
pip install -e .
Use
from oais_utils import validate
validate("../bagit-create/bagitexport::cds::2751237")
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
oais_utils-0.0.4.tar.gz
(19.0 kB
view details)
File details
Details for the file oais_utils-0.0.4.tar.gz
.
File metadata
- Download URL: oais_utils-0.0.4.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e56e9ee1af1ec6840f45c98d10d235750f70ec13ad0dc129acde5e41e5f32de6 |
|
MD5 | de82d114814c162908a759b57448895f |
|
BLAKE2b-256 | c9b36cdcaa224aff9521b6a718907a7312aefa314fa02f87e3207df05edcaefe |