Skip to main content

OAIS utilities

Project description

oais-utilities

PyPI version

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:

  1. Verify directory structure
  2. Validate the manifest file against the desired sip JSON schema. By default uses sip-schema-v1.json, also shipped in this package
  3. Validate the folder as a BagIt package
    • file are allowed to be missing if the manifest specifies it's a "lightweight" SIP.
  4. 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()
# ['v1']

schemas['v1']
# [...]
# (Returns the sip JSON schema "v1" as parsed python object)

schemas['v1']['$id']
# https://gitlab.cern.ch/digitalmemory/sip-spec/-/raw/main/versions/sip-schema-v1.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.4.0.tar.gz (20.5 kB view details)

Uploaded Source

File details

Details for the file oais_utils-0.4.0.tar.gz.

File metadata

  • Download URL: oais_utils-0.4.0.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for oais_utils-0.4.0.tar.gz
Algorithm Hash digest
SHA256 99624895e49cc9428ba2accbc8430d3b7f805f1e3f38171b02fdc1faa26f87f0
MD5 c2894db9e572c3b99251691d95ea70be
BLAKE2b-256 a3f16309ef1861807e85f10a3a2b5f59a82fe497ce466ffda887984fd641bf23

See more details on using hashes here.

Supported by

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