Skip to content

Commit

Permalink
Updated based on builder changes to place encrypted in graph and tidy…
Browse files Browse the repository at this point in the history
… up from RO-Crate group
  • Loading branch information
JLoveUOA committed Jul 16, 2024
1 parent e16a526 commit af3aa94
Show file tree
Hide file tree
Showing 14 changed files with 804 additions and 287 deletions.
Binary file modified dist/mytarids_rocrate-0.1.0-py3-none-any.whl
Binary file not shown.
818 changes: 658 additions & 160 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ readme = "README.md"
packages = [{include = "src"}]

[tool.poetry.dependencies]
python = ">=3.11,<3.12"
python = ">=3.11,<3.12.4"
passpy = "^1.0.2"
ldap3 = "^2.9.1"
python-gnupg = "^0.5.1"
Expand All @@ -29,8 +29,9 @@ backoff = "^2.2.1"
requests = "^2.31.0"
build = "^1.1.1"
pydantic-settings = "^2.2.1"
ro-crate-py = {git = "https://github.com/UoA-eResearch/ro-crate-py.git", branch = "encrypted-metadata"}
mytardis-rocrate-builder = {git = "https://github.com/JLoveUOA/mytardis_rocrate_builder"}
mytardis-rocrate-builder = {git = "https://github.com/JLoveUOA/mytardis_rocrate_builder", branch="optional-identifiers"}
ro-crate-py = {git = "https://github.com/UoA-eResearch/ro-crate-py.git", branch = "move-encrypted-into-graph"}
numpy = "^2.0.0"

[tool.poetry.group.dev.dependencies]
pylint = "^3.1.0"
Expand Down
12 changes: 11 additions & 1 deletion src/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
archive_crate,
bagit_crate,
write_crate,
bulk_encrypt_file
)
from rocrate.rocrate import ROCrate
from slugify import slugify
Expand Down Expand Up @@ -171,6 +172,9 @@ def abi(
)
@OPTION_COLLECT_ALL
@OPTION_CLONE_DIRECTORY
@click.option(
"--bulk_encrypt",type=bool,is_flag=True, default=False, help="Bulk encrypt the entire crate or archive"
)
def print_lab(
input_metadata: Path,
pubkey_fingerprints: list[str],
Expand All @@ -185,6 +189,7 @@ def print_lab(
collect_all: Optional[bool],
gpg_binary: Optional[Path],
duplicate_directory: Optional[bool],
bulk_encrypt: Optional[bool]
) -> None:
"""
Create an RO-Crate based on a Print Lab metadata file
Expand Down Expand Up @@ -254,7 +259,12 @@ def print_lab(
)
if bag_crate:
bagit_crate(crate_destination, mt_user or "")
archive_crate(archive_type, final_output, crate_destination)
if bulk_encrypt:
archive_crate(archive_type, crate_destination, crate_destination, True)
logger.info("Bulk Encrypting RO-Crate")
bulk_encrypt_file(gpg_binary=gpg_binary, pubkey_fingerprints=pubkey_fingerprints, data_to_encrypt=crate_destination,output_path=final_output)
else:
archive_crate(archive_type, final_output, crate_destination, True)


@click.command()
Expand Down
2 changes: 1 addition & 1 deletion src/ingestion_targets/abi_music/abi_json_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

from mytardis_rocrate_builder.rocrate_builder import ROBuilder
from mytardis_rocrate_builder.rocrate_dataclasses.data_class_utils import (
CrateManifest,
convert_to_property_value,
)
from mytardis_rocrate_builder.rocrate_dataclasses.crate_manifest import CrateManifest
from mytardis_rocrate_builder.rocrate_dataclasses.rocrate_dataclasses import (
ContextObject,
Dataset,
Expand Down
2 changes: 1 addition & 1 deletion src/ingestion_targets/abi_music/crate_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from typing import Optional

from mytardis_rocrate_builder.rocrate_dataclasses.data_class_utils import CrateManifest
from mytardis_rocrate_builder.rocrate_dataclasses.crate_manifest import CrateManifest

import src.ingestion_targets.abi_music.consts as profile_consts
from src.cli.mytardisconfig import SchemaConfig
Expand Down
Loading

0 comments on commit af3aa94

Please sign in to comment.