Skip to main content

A Python OCFL Object validator for content in S3

Project description

OCFL S3 Validator

A Python OCFL Object validator for content in S3.

This validator is a simple wrapper for one small part of the Python OCFL validation utility: ocfl-py. This validator only exposes OCFL Object validation for objects that are stored in an S3 object store. The validator has been tested with: AWS, Wasabi, and IBM's S3 storage appliance, "ECS". This validator takes S3 credentials, an optional "endpoint URL" for non-AWS S3 stores, an S3 bucket name, and the S3 path to the OCFL Object root of an OCFL Object. A validation result object is returned for each OCFL Object validation request.

Usage

  1. Create an ObjectValidator with:
    • S3 bucket name
    • S3 access key ID
    • S3 secret access key
    • S3 endpoint URL (optional: needed for non-AWS S3 providers)
  2. Invoke 'validate()' method with:
    • S3 path to single OCFL object
  3. The 'validate()' method returns a result object with:
    • object_id (str): The ID of the object.
    • ocfl_object_path (str): The path to the OCFL object.
    • validation_status (bool): The status of the validation.
    • error_message (str): The error message, if any.
    • validation_timestamp (datetime): The timestamp of the validation.
  4. The result object has a JSON representation by calling: 'result.as_json()'

Example usage

  • See object_validator.py 'main'
from ocfl_s3_validator import ObjectValidator

def example():
    # Define variables used below: 'bucket_name', 'access_key_id', etc

    validator = ObjectValidator(bucket_name,
        access_key_id,
        secret_access_key,
        endpoint_url)
    result = validator.validate(object_id, object_path)

    print(result.as_json())

Developer quick start

A quick set of commands to run after initial cloning this repository

uv venv --python 3.12.0
source .venv/bin/activate
uv sync
pytest

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

ocfl_s3_validator-0.1.2.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ocfl_s3_validator-0.1.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file ocfl_s3_validator-0.1.2.tar.gz.

File metadata

  • Download URL: ocfl_s3_validator-0.1.2.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for ocfl_s3_validator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e7a3410fdd8b86fb73c73ddbe250f5c12b87947f7010a3a83f5fecd60fc535ef
MD5 dcc4b8164769ab6450db179a18808239
BLAKE2b-256 f6d1828343335fcd6f0f4334c099653f9fc8a2d9d461ef180504f59586c81959

See more details on using hashes here.

File details

Details for the file ocfl_s3_validator-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ocfl_s3_validator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee2ecd373a624c244ab31ca2d4cb899ad0f6acf52a83b2f01f4700df97a08bf
MD5 f85c947fbaed2abe5516f77afd9eb0e3
BLAKE2b-256 352dfd6eeab1e708e515fcc00f0f283e5d1d389a94f27246a477f3634a17467f

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