ro-crate-py icon indicating copy to clipboard operation
ro-crate-py copied to clipboard

FEATURE: Load a crate from a (json) Object

Open ptsefton opened this issue 1 year ago • 1 comments

Unless I misunderstand this library can only read crates from disk. It would be very useful to be able to instantiate the library with an object (that would serialise in JSON to an RO-Crate Metadata Document). Eg if I have fetched RO-Crate metadata from an API.

ptsefton avatar Mar 18 '24 03:03 ptsefton

You mean a Python dictionary, I guess. It would be able to point only to web-based data entities

simleo avatar Mar 18 '24 15:03 simleo

It can point to anything as an abstract structure including file paths -- but these not exist for some purposes eg writing a validator that might run in a context other than the place where the files are.

But yes, with an API at the moment if you fetch an RO-Crate metadata document it has to be saved before the library can use it, which is not optimal -- loading raw JSON or a python dictionary structure would be preferable.

ptsefton avatar May 03 '24 05:05 ptsefton

Implemented in #183. The metadata can point to nonexistent files or directories, the behavior when writing the crate is described in #136.

simleo avatar May 10 '24 10:05 simleo

Thanks @simleo - this does not appear to be released yet -- would love to use it

ptsefton avatar Sep 09 '24 23:09 ptsefton

I have just released version 0.11.0

simleo avatar Sep 13 '24 10:09 simleo