From 547a5b3abd9c8912b00ae7a5a5c105a38f46090d Mon Sep 17 00:00:00 2001 From: Mark Baggett Date: Fri, 10 Jan 2020 08:49:43 -0500 Subject: [PATCH] Tag v0.1.3. --- README.rst | 12 +-- changelog.rst | 2 +- docs/moldybread.html | 9 ++- docs/moldybread.idx | 1 + docs/moldybreadpkg/fedora.html | 123 ++++++++++++++++++++---------- docs/moldybreadpkg/fedora.idx | 2 + docs/moldybreadpkg/xmlhelper.html | 35 ++++++++- docs/moldybreadpkg/xmlhelper.idx | 1 + docs/theindex.html | 14 +++- 9 files changed, 147 insertions(+), 52 deletions(-) diff --git a/README.rst b/README.rst index 835daf7..6adfecf 100644 --- a/README.rst +++ b/README.rst @@ -17,10 +17,10 @@ Installing and Building Moldy Bread is designed to be as portable as possible by being compiled in C. -The latest tagged release is available in `releases `_ and compiled with gcc. Depending on your architecture, -you may be able to use the binary available here. +The latest tagged release is available in `releases `_ and compiled with gcc. Depending on your architecture (X86 64Bit Linux), +you may be able to use the binary available here. -For security reasons, no authentication information is stored in the compiled version of the binary. +For security reasons, no authentication information is stored in the compiled version of the binary. For this reason, you must point at a config.yml file. For more information about this, `review the documentation `_. @@ -28,7 +28,7 @@ For this reason, you must point at a config.yml file. For more information abou If you are unable to use the release binrary, you can build a binary with the files in this repository. -1. First, follow the instrucitons here to install nim. +1. First, follow the instructions `here `_ to install nim. Using choosenim is recommended. 2. Make sure you set your PATH appropriately so that nim and nimble can be found. 3. Make sure you have a c compiler like gcc or musl (if not, you'll get an error in step 6). 4. git clone git@github.com:markpbaggett/moldybread.git @@ -38,6 +38,6 @@ If you are unable to use the release binrary, you can build a binary with the fi Documentation ------------- -Documentation for all packages and public procs and types are generated automatically and hosted on `GitHub Pages `_ after each commit. +Documentation for all packages and public procs and types are generated automatically and hosted in this repository with `GitHub Pages `_ after each commit. -Look here for instructions on how to use any piece of Moldy Bread. \ No newline at end of file +Look here for instructions on how to use all operations. diff --git a/changelog.rst b/changelog.rst index 367129a..59edf3e 100644 --- a/changelog.rst +++ b/changelog.rst @@ -2,7 +2,7 @@ Moldy Bread Change Log ====================== -0.1.3 - Upcoming (Not Yet Tagged) +0.1.3 - January 10, 2019 ================================= **Bug Fixes**: diff --git a/docs/moldybread.html b/docs/moldybread.html index 4b88319..174bddd 100644 --- a/docs/moldybread.html +++ b/docs/moldybread.html @@ -837,6 +837,7 @@

MOLDY BREAD

  • Find Objects Missing a Particular Datastream
  • Download Datastream Histories as XML
  • Download Datastream at Date
  • +
  • Download All Versions of a Datastream
  • Validate Checksums
  • Find Unique Datastreams
  • @@ -855,8 +856,9 @@

    MOLDY BREAD

    This package allows users to interact with a Fedora 3.8 repository via the CLI.

    The instructions here assume you are working with a compiled version of Moldy Bread. See installation instructions or package info if you are looking for something else.

    -

    Defining a config.yml

    Make a copy of default_config.yml as config.yml and set settings appropriately. Currently, this is the only way to pass authentication information for Fedora and Gsearch.

    +

    Defining a config.yml

    Make a copy of default_config.yml and set settings appropriately. Currently, this is the only way to pass authentication information for Fedora and Gsearch.

    You can store this config file anywhere that you have read permissions. Use the full path to the file in commands like in the examples below.

    +

    Optionally, as of v0.1.2 you can avoid passing the -y flag on requests by including a directory called config with your yaml as config.yml in the path from where you are executing your command.

    Command Line Parsing

    When in doubt, use help:

    @@ -922,6 +924,9 @@ 

    moldybread -o get_datastream_at_date -n test -d RELS-EXT -dt 2019-12-19 -y /full/path/to/my/yaml/file.yml

    +

    Download All Versions of a Datastream

    You can download all versions of a datastream for a results set and have it serialized as pid-datestampe.extension (test:4-2020-01-07T16:18:28.742Z.xml).

    +
    +moldybread -o download_all_versions -d MODS -t Vancouver -y /full/path/to/my/yaml/file.yml

    Validate Checksums

    You can check whether the current checksum of a datastream for an object matches the original checksum. If not, the objects with bad datastreams are listed:

    Example command:

    @@ -946,7 +951,7 @@ 

    Imports

    diff --git a/docs/moldybread.idx b/docs/moldybread.idx index 243034a..2b9e0ad 100644 --- a/docs/moldybread.idx +++ b/docs/moldybread.idx @@ -13,5 +13,6 @@ Purge Old Versions of a Datastream moldybread.html#purge-old-versions-of-a-datas Find Objects Missing a Particular Datastream moldybread.html#find-objects-missing-a-particular-datastream Find Objects Missing a Particular Datastream Download Datastream Histories as XML moldybread.html#download-datastream-histories-as-xml Download Datastream Histories as XML Download Datastream at Date moldybread.html#download-datastream-at-date Download Datastream at Date +Download All Versions of a Datastream moldybread.html#download-all-versions-of-a-datastream Download All Versions of a Datastream Validate Checksums moldybread.html#validate-checksums Validate Checksums Find Unique Datastreams moldybread.html#find-unique-datastreams Find Unique Datastreams diff --git a/docs/moldybreadpkg/fedora.html b/docs/moldybreadpkg/fedora.html index f5554e8..0400638 100644 --- a/docs/moldybreadpkg/fedora.html +++ b/docs/moldybreadpkg/fedora.html @@ -889,12 +889,16 @@

    fedora

    title="get_datastream_history(this: FedoraRequest; dsid: string): Message">get_datastream_historyFedoraRequest
  • get_datastream_at_dateFedoraRequest
  • +
  • download_all_versions_of_datastreamFedoraRequest
  • validate_checksumsFedoraRequest
  • validate_checksumsFedoraRequest
  • find_distinct_datastreamsFedoraRequest
  • +
  • get_content_modelsFedoraRequest
  • @@ -929,7 +933,7 @@

    Types

    Type to Handle Fedora requests   Source Edit @@ -944,7 +948,7 @@

    Types

    Type to handle messaging   Source Edit @@ -966,9 +970,9 @@

    Procs

    let fedora_connection = initFedoraRequest(pid_part="test")

    Example with dc_values string:

    let fedora_connection = initFedoraRequest(dc_values="title:Pencil;contributor:Wiley")
      Source -Edit +Edit @@ -988,9 +992,9 @@

    Methods

    let fedora_connection = initFedoraRequest(pid_part="test")
     echo fedora_connection.populate_results()
      Source -Edit +Edit @@ -1006,9 +1010,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() discard fedora_connection.harvest_datastream("DC")   Source -Edit +Edit @@ -1026,18 +1030,18 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() discard fedora_connection.harvest_datastream_no_pages("DC")   Source -Edit +Edit
    method update_metadata(this: FedoraRequest; datastream_id, directory: string;
                           gsearch_auth: (string, string); clean_up = false): Message {...}{.
    -    base, raises: [ValueError, IOError, OverflowError, SslError, OSError, TimeoutError,
    -                 ProtocolError, KeyError, Defect, HttpRequestError, Exception,
    -                 XmlError, RegexError, InvalidPositionError], tags: [ReadEnvEffect,
    -    ReadDirEffect, WriteIOEffect, ReadIOEffect, TimeEffect, RootEffect].}
    + base, raises: [ValueError, IOError, HttpRequestError, SslError, OSError, + TimeoutError, ProtocolError, KeyError, Defect, Exception, XmlError, + RegexError, OverflowError, InvalidPositionError], tags: [ + ReadDirEffect, ReadEnvEffect, WriteIOEffect, ReadIOEffect, TimeEffect, RootEffect].}

    Updates metadata records based on files in a directory.

    @@ -1046,9 +1050,9 @@

    Methods

    let fedora_connection = initFedoraRequest(pid_part="test")
     discard fedora_connection.update_metadata("MODS", "/home/mark/nim_projects/moldybread/experiment")
      Source -Edit +Edit
    @@ -1065,9 +1069,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() discard fedora_connection.download_foxml().successes   Source -Edit +Edit @@ -1083,9 +1087,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() doAssert(typeOf(fedora_connection.version_datastream("MODS", false)) == Message)   Source -Edit +Edit @@ -1101,9 +1105,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() doAssert(typeOf(fedora_connection.change_object_state("I")) == Message)   Source -Edit +Edit @@ -1120,9 +1124,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() doAssert(typeOf(fedora_connection.purge_old_versions_of_datastream("MODS")) == Message)   Source -Edit +Edit @@ -1138,9 +1142,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() echo fedora_connection.find_objects_missing_datastream("RELS-INT").errors   Source -Edit +Edit @@ -1154,13 +1158,13 @@

    Methods

    Returns a sequence of tuples with the pid and a sequence of datastreams that belong to it.

    Optionally, you can specify whether you want an entire datastream profile returned (defaults to true) or just the datastream id and a date for which you want to base the query on (defaults to now). Use yyyy-MM-dd or yyyy-MM-ddTHH:mm:ssZ.

    Example:

    -
    let let fedora_connection = initFedoraRequest(output_directory="/home/mark/nim_projects/moldybread/experiment", pid_part="test")
    +
    let fedora_connection = initFedoraRequest(output_directory="/home/mark/nim_projects/moldybread/experiment", pid_part="test")
     fedora_connection.results = fedora_connection.populate_results()
     echo fedora_connection.get_datastreams(profiles=true)
      Source -Edit +Edit @@ -1176,9 +1180,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() echo fedora_connection.get_datastream_history("MODS").successes
      Source -Edit +Edit @@ -1195,9 +1199,29 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() discard fedora_connection.get_datastream_at_date("DC", "2019-12-25")   Source +Edit + + + +
    method download_all_versions_of_datastream(this: FedoraRequest; dsid: string): Message {...}{.
    +    base, raises: [ValueError, IOError, HttpRequestError, SslError, OSError,
    +                 TimeoutError, ProtocolError, KeyError, Defect, Exception, XmlError,
    +                 RegexError, InvalidPositionError], tags: [ReadEnvEffect,
    +    WriteIOEffect, ReadIOEffect, TimeEffect, RootEffect, ReadDirEffect,
    +    WriteDirEffect].}
    +
    + +

    Downloads all versions of a specific datastream and names it as pid-datetime.extension (test:223-2020-01-07T17:25:32.085Z.xml).

    +

    Example:

    +
    let fedora_connection = initFedoraRequest(output_directory="/home/mark/nim_projects/moldybread/experiment", pid_part="test")
    +fedora_connection.results = fedora_connection.populate_results()
    +echo fedora_connection.download_all_versions_of_datastream("MODS").successes
    +  Source -Edit +Edit
    @@ -1215,9 +1239,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() echo fedora_connection.validate_checksums("MODS").successes   Source -Edit +Edit @@ -1235,9 +1259,9 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() echo fedora_connection.validate_checksums().errors   Source -Edit +Edit @@ -1254,9 +1278,28 @@

    Methods

    fedora_connection.results = fedora_connection.populate_results() echo fedora_connection.find_distinct_datastreams()   Source +Edit + + + +
    method get_content_models(this: FedoraRequest): seq[(string, string)] {...}{.base, raises: [
    +    ValueError, IOError, HttpRequestError, SslError, OSError, TimeoutError,
    +    ProtocolError, KeyError, Defect, Exception, XmlError, RegexError,
    +    InvalidPositionError],
    +    tags: [ReadEnvEffect, WriteIOEffect, ReadIOEffect, TimeEffect, RootEffect].}
    +
    + +

    Returns a sequence of tuples with pids with a human readable version of its content model.

    +

    Example:

    +
    let fedora_connection = initFedoraRequest(output_directory="/home/mark/nim_projects/moldybread/experiment", pid_part="test")
    +fedora_connection.results = fedora_connection.populate_results()
    +echo fedora_connection.get_content_models()
    +  Source -Edit +Edit
    @@ -1269,7 +1312,7 @@

    Methods

    diff --git a/docs/moldybreadpkg/fedora.idx b/docs/moldybreadpkg/fedora.idx index 4cd859d..275e399 100644 --- a/docs/moldybreadpkg/fedora.idx +++ b/docs/moldybreadpkg/fedora.idx @@ -13,6 +13,8 @@ find_objects_missing_datastream moldybreadpkg/fedora.html#find_objects_missing_d get_datastreams moldybreadpkg/fedora.html#get_datastreams.e,FedoraRequest fedora: get_datastreams(this: FedoraRequest; profiles = true; as_of_date = getTime()): seq[\n (string, seq[TaintedString])] get_datastream_history moldybreadpkg/fedora.html#get_datastream_history.e,FedoraRequest,string fedora: get_datastream_history(this: FedoraRequest; dsid: string): Message get_datastream_at_date moldybreadpkg/fedora.html#get_datastream_at_date.e,FedoraRequest,string,string fedora: get_datastream_at_date(this: FedoraRequest; dsid: string; date: string): Message +download_all_versions_of_datastream moldybreadpkg/fedora.html#download_all_versions_of_datastream.e,FedoraRequest,string fedora: download_all_versions_of_datastream(this: FedoraRequest; dsid: string): Message validate_checksums moldybreadpkg/fedora.html#validate_checksums.e,FedoraRequest,string fedora: validate_checksums(this: FedoraRequest; dsid: string): Message validate_checksums moldybreadpkg/fedora.html#validate_checksums.e,FedoraRequest fedora: validate_checksums(this: FedoraRequest): Message find_distinct_datastreams moldybreadpkg/fedora.html#find_distinct_datastreams.e,FedoraRequest fedora: find_distinct_datastreams(this: FedoraRequest): seq[string] +get_content_models moldybreadpkg/fedora.html#get_content_models.e,FedoraRequest fedora: get_content_models(this: FedoraRequest): seq[(string, string)] diff --git a/docs/moldybreadpkg/xmlhelper.html b/docs/moldybreadpkg/xmlhelper.html index 70ba12d..cee868f 100644 --- a/docs/moldybreadpkg/xmlhelper.html +++ b/docs/moldybreadpkg/xmlhelper.html @@ -828,6 +828,8 @@

    xmlhelper

    @@ -871,10 +873,39 @@

    Procs

    an_element = "dsChecksumValid" assert parsedata(some_xml, an_element) == @["true"]   Source Edit + + +
    proc get_attribute_of_element(response, element, attribute: string): seq[string] {...}{.raises: [
    +    Defect, IOError, OSError, ValueError, Exception, XmlError, RegexError],
    +    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
    +
    + +

    Terrible code to try to find matching attribute values for nodes in a string of XML.

    +

    Example:

    +
    let
    +  some_xml = """<rdf:RDF xmlns:fedora="info:fedora/fedora-system:def/relations-external#" xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:islandora="http://islandora.ca/ontology/relsext#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    +    <rdf:Description rdf:about="info:fedora/test:6">
    +    <islandora:isPageOf rdf:resource="info:fedora/test:3"></islandora:isPageOf>
    +    <islandora:isSequenceNumber>2</islandora:isSequenceNumber>
    +    <islandora:isPageNumber>2</islandora:isPageNumber>
    +    <islandora:isSection>1</islandora:isSection>
    +    <fedora:isMemberOf rdf:resource="info:fedora/test:3"></fedora:isMemberOf>
    +    <fedora-model:hasModel rdf:resource="info:fedora/islandora:pageCModel"></fedora-model:hasModel>
    +    <islandora:generate_ocr>TRUE</islandora:generate_ocr>
    +    </rdf:Description>
    +    </rdf:RDF>"""
    +  an_element = "fedora-model:hasModel"
    +  an_attribute = "rdf:resource"
    +assert get_attribute_of_element(some_xml, an_element, an_attribute) == @["info:fedora/islandora:pageCModel"]
    +  Source +Edit +
    @@ -886,7 +917,7 @@

    Procs

    diff --git a/docs/moldybreadpkg/xmlhelper.idx b/docs/moldybreadpkg/xmlhelper.idx index 4145491..33d788e 100644 --- a/docs/moldybreadpkg/xmlhelper.idx +++ b/docs/moldybreadpkg/xmlhelper.idx @@ -1 +1,2 @@ parse_data moldybreadpkg/xmlhelper.html#parse_data,string,string xmlhelper: parse_data(response, element: string): seq[string] +get_attribute_of_element moldybreadpkg/xmlhelper.html#get_attribute_of_element,string,string,string xmlhelper: get_attribute_of_element(response, element, attribute: string): seq[string] diff --git a/docs/theindex.html b/docs/theindex.html index 6ecd2d4..a9825b6 100644 --- a/docs/theindex.html +++ b/docs/theindex.html @@ -810,6 +810,10 @@

    Index

  • fedora: change_object_state(this: FedoraRequest; state: string): Message
  • +
    download_all_versions_of_datastream:
    download_foxml:
    +
    get_attribute_of_element:
    +
    get_content_models:
    get_datastream_at_date: