Skip to content

Commit

Permalink
prep for 0.0.1 proof of concept
Browse files Browse the repository at this point in the history
  • Loading branch information
R. S. Doiel committed Dec 9, 2024
1 parent eeb2528 commit c1839b4
Show file tree
Hide file tree
Showing 57 changed files with 1,427 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
#*_dialog.md
*_dialog.html
development_approach.html
bin/*
man/*
dist/*
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ maintainers:
orcid: ""

repository-code: "https://github.com/caltechlibrary/metadatatools"
version: 0.0.0
version: 0.0.1
license-url: "https://caltechlibrary.github.io/metadatatools/LICENSE"
keywords: [ "metadata", "identifiers" ]
52 changes: 44 additions & 8 deletions INSTALL.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,53 @@
<section>
<h1 id="installation">Installation</h1>
<p>This project is experiment and yet to reach the working proof of
concept stage. There is no installation process beyond clone this
repository.</p>
<pre><code>git clone https://github.com/caltechlibrary/metadatatools
cd metadatatools
make</code></pre>
<h2 id="software-requiremets">Software Requiremets</h2>
concept stage. There is only a mimimal installation process beyond
cloning this repository and building from source.</p>
<h2 id="quick-install-with-curl-or-irm">Quick install with curl or
irm</h2>
<p>There is an experimental installer.sh script that can be run with the
following command to install latest table release. This may work for
macOS, Linux and if you’re using Windows with the Unix subsystem. This
would be run from your shell (e.g. Terminal on macOS).</p>
<p>curl https://caltechlibrary.github.io/metadatatools/installer.sh |
sh</p>
<p>This will install dataset and datasetd in your $HOME/bin
directory.</p>
<p>If you are running Windows 10 or 11 use the Powershell command
below.</p>
<p>irm https://caltechlibrary.github.io/metadatatools/installer.ps1 |
iex</p>
<p>If your want to install a specific verions set the PKG_VERSION
environment variable then download. E.g. version 0.0.1 in tihs
example.</p>
<p>For Linux and macOS</p>
<p>export PKG_VERSION=0.0.1 curl
https://caltechlibrary.github.io/metadatatools/installer.sh | sh</p>
<p>For Windows</p>
<p>$env:PKG_VERSION = ‘0.0.1’ irm
https://caltechlibrary.github.io/metadatatools/installer.ps1 | iex</p>
<h2 id="build-and-install-from-source">Build and install from
source</h2>
<h3 id="software-requiremets-for-building-from-source">Software
Requiremets for building from source</h3>
<ul>
<li>Deno &gt;= 2.1.2</li>
<li>Pandoc &gt;= 3.1</li>
<li>Deno &gt;= 2.1.3</li>
<li>Pandoc &gt;= 3.1.12</li>
<li>GNU Make &gt;= 3.81</li>
</ul>
<h3 id="steps">Steps</h3>
<ol type="1">
<li>Clone the GitHub repository</li>
<li>change into the metadatatools directory</li>
<li>Run <code>make</code></li>
<li>Run <code>make test</code></li>
<li>Run <code>make install</code></li>
</ol>
<pre><code>git clone https://github.com/caltechlibrary/metadatatools
cd metadatatools
make
make test
make install</code></pre>
</section>

<footer>
Expand Down
51 changes: 45 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,57 @@

# Installation

This project is experiment and yet to reach the working proof of concept stage. There is no installation process beyond clone this repository.
This project is experiment and yet to reach the working proof of concept stage. There is only a mimimal installation process beyond cloning this repository and building from source.

## Quick install with curl or irm

There is an experimental installer.sh script that can be run with the following command to install latest table release. This may work for macOS, Linux and if you’re using Windows with the Unix subsystem. This would be run from your shell (e.g. Terminal on macOS).

curl https://caltechlibrary.github.io/metadatatools/installer.sh | sh

This will install dataset and datasetd in your $HOME/bin directory.

If you are running Windows 10 or 11 use the Powershell command below.

irm https://caltechlibrary.github.io/metadatatools/installer.ps1 | iex

If your want to install a specific verions set the PKG_VERSION environment variable then download. E.g. version 0.0.1 in tihs example.

For Linux and macOS

export PKG_VERSION=0.0.1
curl https://caltechlibrary.github.io/metadatatools/installer.sh | sh

For Windows

$env:PKG_VERSION = '0.0.1'
irm https://caltechlibrary.github.io/metadatatools/installer.ps1 | iex



## Build and install from source

### Software Requiremets for building from source

- Deno >= 2.1.3
- Pandoc >= 3.1.12
- GNU Make >= 3.81

### Steps

1. Clone the GitHub repository
2. change into the metadatatools directory
3. Run `make`
4. Run `make test`
4. Run `make install`

~~~
git clone https://github.com/caltechlibrary/metadatatools
cd metadatatools
make
make test
make install
~~~

## Software Requiremets

- Deno >= 2.1.2
- Pandoc >= 3.1
- GNU Make >= 3.81


4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ build: version.ts $(TS_MODS) CITATION.cff about.md bin compile installer.sh inst

bin: .FORCE
mkdir -p bin
-if [ -d bin ]; then rm bin/*; fi

compile: check $(TS_MODS)
deno task build
bin/mtd$(EXT) --help >mtd.1.md
./bin/mdt$(EXT) --help >mtd.1.md

check: $(TS_MODS)

Expand Down Expand Up @@ -133,7 +134,6 @@ distribute_docs: website setup_dist
@cp CITATION.cff dist/
@cp *.1.md dist/
@cp INSTALL.md dist/
@cp deployment.md dist/
@cp -vR man dist/

dist/Linux-x86_64: .FORCE
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,26 @@ verification
- VIAF
- SNAC

# USAGE

There are two ways to use Metadata Tools. The first is via the command line program `mdt`. This simple command line program accepts three parameters, ACTION, ID_TYPE and IDENTIFIER. See [man page for details](mdt.1.md). An ACTION can be one of three things, "normalize", "validate" and "verify". The second parameter is one of the types listed above. The final parameter the identifier value. "normalize" will accept an identifier in a common format variation and return a consisantly formated result. E.g. The ORCID "https://orcid.org/0000-0003-0900-6903" will be normalize to "0000-0003-0900-6903" where as an ROR of "05dxps055" will normalize to "https://ror.org/05dxps055". The normalization appplied reflects the typical way we handle the idenfier formatting in Caltech Library's repository systems.

"validate" will check of the identifier matches and expected form. E.g. An order looks like four digits dash four digits dash four digits dash for digits. There is some check summing also applied to validate the sequence (like with ISNI). Validate will make sure the supplied identifier confirms to those types of rules. It **does not verify** the value with the originating organization.

"verify" will validate the identifier supplied then check via a web service if the identifier is known to the sponsoring organization or authority control. As a result it requires network access and will fail if the sponsoring organization's website or service is unavailable.

Both "validate" and "verfiy" return booleaning true if everything checks out and false otherwise. The command line program `mtd` will also return a non-zero exit code if the validation or verification fails.

The second way Metadata Tools can be use is as a [ESM](https://en.wikipedia.org/wiki/ECMAScript#6th_Edition_%E2%80%93_ECMAScript_2015 "ECMAScript Module") TypeScript module. The TypeScript module you can use from [Deno](https://deno.com). The latest version of the Metadata Tools module can be found at <https://github.com/caltechlibrary/metadatatools/latest/release> and on the Caltech Library development group's GitHub website, <https://caltechlibrary.github.io/metadatatools/mod.ts>. The `mod.ts` file will pull in the whole set of identifier normalization, validation and verification routines.

## Installation

The command line program can be installed using installer scripts hosted at <https://caltechlibrary.github.io/metadatatools>. See [INSTALL.md](INSTALL.md) for details.

While Metadata Tools should be considered experimental binaries are being provided for macOS (x86_64 and M series processes), Windows 11 running on x86_64 processors and for Linux on x86_64 and aarch64 processesor.

## License

See [LICENSE](./LICENSE) for license details.


2 changes: 1 addition & 1 deletion about.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<section>
<h1 id="about-this-software">About this software</h1>
<h2 id="metadatatools-0.0.0">metadatatools 0.0.0</h2>
<h2 id="metadatatools-0.0.1">metadatatools 0.0.1</h2>
<h3 id="authors">Authors</h3>
<ul>
<li>R. S. Doiel</li>
Expand Down
4 changes: 2 additions & 2 deletions about.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors:
orcid: "https://orcid.org/0000-0003-0900-6903"

repository-code: "https://github.com/caltechlibrary/metadatatools"
version: 0.0.0
version: 0.0.1
license-url: "https://caltechlibrary.github.io/metadatatools/LICENSE"
keywords: [ "metadata", "identifiers" ]

Expand All @@ -20,7 +20,7 @@ keywords: [ "metadata", "identifiers" ]
About this software
===================

## metadatatools 0.0.0
## metadatatools 0.0.1

### Authors

Expand Down
12 changes: 12 additions & 0 deletions ancillary/mk_deps.ts.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

ls -1 *.ts | grep -v '_test.ts' | grep -v 'deps.ts'| grep -v 'demo_' | grep -v 'mod.ts' \
while read -r FNAME; do
echo
echo "// ${FNAME} export"
echo "export {"
grep 'export' "${FNAME}" | \
grep -v 'export {' | \
cut -d '(' -f 1 | \
sed -E 's/export//;s/function//;s/async//';
echo "} from './${FNAME}';" ;
done
Loading

0 comments on commit c1839b4

Please sign in to comment.