From f83833478531369cc932ad1731ad11f38a89a284 Mon Sep 17 00:00:00 2001
From: "R. S. Doiel"
Date: Thu, 7 Nov 2024 09:49:48 -0800
Subject: [PATCH] prep for v1.2.12 release
---
CITATION.cff | 2 +-
Makefile | 6 +-----
about.html | 2 +-
about.md | 4 ++--
codemeta.json | 8 ++++----
codemeta/codemeta.go | 15 ++++++++++++++-
codemeta/codemeta_test.go | 17 +++++++++++++++++
codemeta2cff.1.md | 4 ++--
csv2json.1.md | 4 ++--
csv2mdtable.1.html | 2 +-
csv2mdtable.1.md | 6 +++---
csv2tab.1.html | 2 +-
csv2tab.1.md | 6 +++---
csv2xlsx.1.html | 2 +-
csv2xlsx.1.md | 6 +++---
csvcleaner.1.html | 2 +-
csvcleaner.1.md | 6 +++---
csvcols.1.html | 2 +-
csvcols.1.md | 6 +++---
csvfind.1.html | 2 +-
csvfind.1.md | 6 +++---
csvjoin.1.html | 2 +-
csvjoin.1.md | 6 +++---
csvrows.1.html | 2 +-
csvrows.1.md | 6 +++---
finddir.1.html | 2 +-
finddir.1.md | 6 +++---
findfile.1.html | 2 +-
findfile.1.md | 6 +++---
go.mod | 11 +++++++----
go.sum | 14 ++++++++++----
installer.ps1 | 2 +-
installer.sh | 2 +-
json2toml.1.html | 2 +-
json2toml.1.md | 6 +++---
json2yaml.1.html | 2 +-
json2yaml.1.md | 6 +++---
jsoncols.1.html | 2 +-
jsoncols.1.md | 6 +++---
jsonjoin.1.md | 4 ++--
jsonmunge.1.html | 2 +-
jsonmunge.1.md | 6 +++---
jsonobjects2csv.1.html | 2 +-
jsonobjects2csv.1.md | 6 +++---
jsonrange.1.html | 2 +-
jsonrange.1.md | 6 +++---
mergepath.1.html | 2 +-
mergepath.1.md | 6 +++---
pagefind/fragment/unknown_15a4aa1.pf_fragment | Bin 0 -> 790 bytes
pagefind/fragment/unknown_1aa95ce.pf_fragment | Bin 0 -> 1378 bytes
pagefind/fragment/unknown_1db3da4.pf_fragment | Bin 0 -> 471 bytes
pagefind/fragment/unknown_371b3dd.pf_fragment | Bin 0 -> 805 bytes
pagefind/fragment/unknown_37491a9.pf_fragment | Bin 0 -> 985 bytes
pagefind/fragment/unknown_37d96f7.pf_fragment | Bin 0 -> 527 bytes
pagefind/fragment/unknown_3ae136a.pf_fragment | Bin 0 -> 1074 bytes
pagefind/fragment/unknown_3d98e2a.pf_fragment | Bin 0 -> 820 bytes
pagefind/fragment/unknown_3ee6719.pf_fragment | Bin 0 -> 678 bytes
pagefind/fragment/unknown_498cd8a.pf_fragment | Bin 0 -> 807 bytes
pagefind/fragment/unknown_5a9357b.pf_fragment | Bin 0 -> 678 bytes
pagefind/fragment/unknown_66b43ef.pf_fragment | Bin 0 -> 612 bytes
pagefind/fragment/unknown_696c209.pf_fragment | Bin 0 -> 522 bytes
pagefind/fragment/unknown_7486219.pf_fragment | Bin 0 -> 556 bytes
pagefind/fragment/unknown_7c76eb6.pf_fragment | Bin 0 -> 491 bytes
pagefind/fragment/unknown_a1ac413.pf_fragment | Bin 0 -> 671 bytes
pagefind/fragment/unknown_a7f3f7a.pf_fragment | Bin 0 -> 648 bytes
pagefind/fragment/unknown_a9a7bdf.pf_fragment | Bin 0 -> 693 bytes
pagefind/fragment/unknown_aab8c7c.pf_fragment | Bin 0 -> 683 bytes
pagefind/fragment/unknown_ca4f8da.pf_fragment | Bin 0 -> 931 bytes
pagefind/fragment/unknown_cd4b107.pf_fragment | Bin 0 -> 519 bytes
pagefind/fragment/unknown_d446f42.pf_fragment | Bin 0 -> 501 bytes
pagefind/fragment/unknown_d762f59.pf_fragment | Bin 0 -> 599 bytes
pagefind/fragment/unknown_ecebd9b.pf_fragment | Bin 0 -> 1027 bytes
pagefind/fragment/unknown_f4a09ee.pf_fragment | Bin 0 -> 1003 bytes
pagefind/fragment/unknown_f54af95.pf_fragment | Bin 0 -> 1371 bytes
pagefind/fragment/unknown_fedda69.pf_fragment | Bin 0 -> 1297 bytes
pagefind/index/unknown_1599c9a.pf_index | Bin 0 -> 25763 bytes
pagefind/pagefind-entry.json | 2 +-
pagefind/pagefind-ui.js | 4 ++--
pagefind/pagefind.js | 2 +-
.../pagefind.unknown_b03416a0885a4d1.pf_meta | Bin 0 -> 1537 bytes
pagefind/wasm.unknown.pagefind | Bin 66651 -> 66552 bytes
range.1.md | 4 ++--
reldate.1.html | 2 +-
reldate.1.md | 6 +++---
release.bash | 6 +++---
reltime.1.md | 4 ++--
sql2csv.1.md | 4 ++--
string.1.html | 2 +-
string.1.md | 6 +++---
tab2csv.1.html | 2 +-
tab2csv.1.md | 6 +++---
timefmt.1.html | 2 +-
timefmt.1.md | 6 +++---
toml2json.1.html | 2 +-
toml2json.1.md | 6 +++---
urlparse.1.html | 2 +-
urlparse.1.md | 6 +++---
version.go | 6 +++---
xlsx2csv.1.html | 2 +-
xlsx2csv.1.md | 6 +++---
xlsx2json.1.html | 2 +-
xlsx2json.1.md | 6 +++---
yaml2json.1.html | 2 +-
yaml2json.1.md | 6 +++---
104 files changed, 185 insertions(+), 150 deletions(-)
create mode 100644 pagefind/fragment/unknown_15a4aa1.pf_fragment
create mode 100644 pagefind/fragment/unknown_1aa95ce.pf_fragment
create mode 100644 pagefind/fragment/unknown_1db3da4.pf_fragment
create mode 100644 pagefind/fragment/unknown_371b3dd.pf_fragment
create mode 100644 pagefind/fragment/unknown_37491a9.pf_fragment
create mode 100644 pagefind/fragment/unknown_37d96f7.pf_fragment
create mode 100644 pagefind/fragment/unknown_3ae136a.pf_fragment
create mode 100644 pagefind/fragment/unknown_3d98e2a.pf_fragment
create mode 100644 pagefind/fragment/unknown_3ee6719.pf_fragment
create mode 100644 pagefind/fragment/unknown_498cd8a.pf_fragment
create mode 100644 pagefind/fragment/unknown_5a9357b.pf_fragment
create mode 100644 pagefind/fragment/unknown_66b43ef.pf_fragment
create mode 100644 pagefind/fragment/unknown_696c209.pf_fragment
create mode 100644 pagefind/fragment/unknown_7486219.pf_fragment
create mode 100644 pagefind/fragment/unknown_7c76eb6.pf_fragment
create mode 100644 pagefind/fragment/unknown_a1ac413.pf_fragment
create mode 100644 pagefind/fragment/unknown_a7f3f7a.pf_fragment
create mode 100644 pagefind/fragment/unknown_a9a7bdf.pf_fragment
create mode 100644 pagefind/fragment/unknown_aab8c7c.pf_fragment
create mode 100644 pagefind/fragment/unknown_ca4f8da.pf_fragment
create mode 100644 pagefind/fragment/unknown_cd4b107.pf_fragment
create mode 100644 pagefind/fragment/unknown_d446f42.pf_fragment
create mode 100644 pagefind/fragment/unknown_d762f59.pf_fragment
create mode 100644 pagefind/fragment/unknown_ecebd9b.pf_fragment
create mode 100644 pagefind/fragment/unknown_f4a09ee.pf_fragment
create mode 100644 pagefind/fragment/unknown_f54af95.pf_fragment
create mode 100644 pagefind/fragment/unknown_fedda69.pf_fragment
create mode 100644 pagefind/index/unknown_1599c9a.pf_index
create mode 100644 pagefind/pagefind.unknown_b03416a0885a4d1.pf_meta
diff --git a/CITATION.cff b/CITATION.cff
index 5bc04427..3b39bfbb 100644
--- a/CITATION.cff
+++ b/CITATION.cff
@@ -15,6 +15,6 @@ maintainers:
orcid: "https://orcid.org/0000-0003-0900-6903"
repository-code: "https://github.com/caltechlibrary/datatools"
-version: 1.2.11
+version: 1.2.12
license-url: "https://data.caltech.edu/license"
keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]
diff --git a/Makefile b/Makefile
index b38320bc..e2a6634a 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ RELEASE_DATE=$(shell date +'%Y-%m-%d')
RELEASE_HASH=$(shell git log --pretty=format:'%h' -n 1)
-
PROGRAMS = codemeta2cff csv2json csv2mdtable csv2tab csv2xlsx csvcleaner csvcols csvfind csvjoin csvrows finddir findfile json2toml json2yaml jsoncols jsonjoin jsonmunge jsonrange mergepath range reldate reltime sql2csv string tab2csv timefmt toml2json urlparse xlsx2csv xlsx2json yaml2json jsonobjects2csv
MAN_PAGES = codemeta2cff.1 csv2json.1 csv2mdtable.1 csv2tab.1 csv2xlsx.1 csvcleaner.1 csvcols.1 csvfind.1 csvjoin.1 csvrows.1 finddir.1 findfile.1 json2toml.1 json2yaml.1 jsoncols.1 jsonjoin.1 jsonmunge.1 jsonrange.1 mergepath.1 range.1 reldate.1 reltime.1 sql2csv.1 string.1 tab2csv.1 timefmt.1 toml2json.1 urlparse.1 xlsx2csv.1 xlsx2json.1 yaml2json.1 jsonobjects2csv.1
@@ -48,9 +47,6 @@ version.go: .FORCE
--template codemeta-version-go.tmpl \
LICENSE >version.go
-
-
-
about.md: codemeta.json .FORCE
cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
if [ -f $(PANDOC) ]; then echo "" | $(PANDOC) --metadata title="About $(PROJECT)" --metadata-file=_codemeta.json --template=codemeta-md.tmpl >about.md; fi
@@ -218,7 +214,7 @@ gen_batfiles: .FORCE
snap: dist/datatools_$(VERSION)_amd64.snap
-release: .FORCE installer.sh clean build man gen_batfiles distribute_docs dist/Linux-x86_64 dist/macOS-x86_64 dist/macOS-arm64 dist/Windows-x86_64 dist/Windows-arm64 dist/Linux-armv7l dist/Linux-aarch64
+release: .FORCE clean build man gen_batfiles distribute_docs dist/Linux-armv7l dist/Linux-aarch64 dist/Linux-x86_64 dist/macOS-x86_64 dist/macOS-arm64 dist/Windows-x86_64 dist/Windows-arm64
.FORCE:
diff --git a/about.html b/about.html
index 19c9ffd8..a8df0423 100644
--- a/about.html
+++ b/about.html
@@ -25,7 +25,7 @@
About this software
-
+
Authors
- R. S. Doiel
diff --git a/about.md b/about.md
index 0da814bf..f32ab706 100644
--- a/about.md
+++ b/about.md
@@ -11,7 +11,7 @@ authors:
orcid: "https://orcid.org/0000-0003-0900-6903"
repository-code: "https://github.com/caltechlibrary/datatools"
-version: 1.2.11
+version: 1.2.12
license-url: "https://data.caltech.edu/license"
keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]
@@ -20,7 +20,7 @@ keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]
About this software
===================
-## datatools 1.2.11
+## datatools 1.2.12
### Authors
diff --git a/codemeta.json b/codemeta.json
index 9cef0152..26b23c5c 100644
--- a/codemeta.json
+++ b/codemeta.json
@@ -4,14 +4,14 @@
"license": "https://data.caltech.edu/license",
"codeRepository": "https://github.com/caltechlibrary/datatools",
"dateCreated": "2017-02-06",
- "dateRelease": "2024-10-24",
- "dateModified": "2024-10-24",
+ "dateRelease": "2024-11-07",
+ "dateModified": "2024-11-07",
"downloadUrl": "https://github.com/caltechlibrary/datatools/releases/",
"issueTracker": "https://github.com/caltechlibrary/datatools/issues",
"name": "datatools",
- "version": "1.2.11",
+ "version": "1.2.12",
"description": "A set of command line tools for working with CSV, Excel Workbooks, JSON and structured text documents.",
- "releaseNotes": "fix isssue#21, CopyrightYear is an int",
+ "releaseNotes": "fix issue #22, identifying DOI without http prefix",
"applicationCategory": "computer programming",
"developmentStatus": "active",
"funder": {
diff --git a/codemeta/codemeta.go b/codemeta/codemeta.go
index 23ed701e..2b1974fb 100644
--- a/codemeta/codemeta.go
+++ b/codemeta/codemeta.go
@@ -7,6 +7,9 @@ import (
// Caltech Library package
"github.com/caltechlibrary/doitools"
+
+ // 3rd Party Package
+ "github.com/hscells/doi"
)
type PersonOrOrganization struct {
@@ -53,6 +56,7 @@ type Codemeta struct {
// Additional codemeta Terms are defined at https://codemeta.github.io/terms/
}
+
func (person *PersonOrOrganization) ToJSON() ([]byte, error) {
return JSONMarshalIndent(person, "", "\t")
}
@@ -71,6 +75,15 @@ func (person *PersonOrOrganization) ToCFF() ([]byte, error) {
orcid: %s`, person.FamilyName, person.GivenName, person.Id)), nil
}
+// Check if identifier is a DOI
+func isDOI(identifier string) bool {
+ doi, err := doi.Parse(identifier)
+ if err != nil {
+ return false
+ }
+ return doi.IsValid()
+}
+
// ToCff crosswalks a Codemeta data structure rendering
// CITATION.cff document as an array of byte.
// Based on documentation at https://citation-file-format.github.io/
@@ -96,7 +109,7 @@ repository-code: %q`, cm.CodeRepository))...)
src = append(src, []byte(`
type: software`)...)
}
- if strings.HasPrefix(cm.Identifier, "https://doi.org/") {
+ if isDOI(cm.Identifier) {
if doi, err := doitools.NormalizeDOI(cm.Identifier); err == nil {
src = append(src, []byte(fmt.Sprintf(`
doi: %s`, doi))...)
diff --git a/codemeta/codemeta_test.go b/codemeta/codemeta_test.go
index 1fc13b79..570924d8 100644
--- a/codemeta/codemeta_test.go
+++ b/codemeta/codemeta_test.go
@@ -4,6 +4,23 @@ import (
"testing"
)
+func TestIsDOI(t *testing.T) {
+ identifier := "10.22002/5rbqw-9cc91"
+ expected := true
+ got := isDOI(identifier)
+ if expected != got {
+ t.Errorf("for %q, expected %t, got %t", identifier, expected, got)
+ }
+ identifier = "0000-1111-2222-3333"
+ expected = false
+ got = isDOI(identifier)
+ if expected != got {
+ t.Errorf("for %q, expected %t, got %t", identifier, expected, got)
+ }
+
+
+}
+
func TestCodemeta(t *testing.T) {
t.Errorf("TestCodemeta() not implemented.")
}
diff --git a/codemeta2cff.1.md b/codemeta2cff.1.md
index 57e22072..15ac269c 100644
--- a/codemeta2cff.1.md
+++ b/codemeta2cff.1.md
@@ -1,6 +1,6 @@
-%codemeta2cff(1) user manual | version 1.2.11 ff4493f
+%codemeta2cff(1) user manual | version 1.2.12 1128bff
% R. S. Doiel
-% 2024-10-24
+% 2024-11-07
# NAME
diff --git a/csv2json.1.md b/csv2json.1.md
index c7c66bb8..afb07152 100644
--- a/csv2json.1.md
+++ b/csv2json.1.md
@@ -1,6 +1,6 @@
-%csv2json(1) user manual | version 1.2.11 ff4493f
+%csv2json(1) user manual | version 1.2.12 1128bff
% R. S. Doiel
-% 2024-10-24
+% 2024-11-07
# NAME
diff --git a/csv2mdtable.1.html b/csv2mdtable.1.html
index 4b76f067..7d230eeb 100644
--- a/csv2mdtable.1.html
+++ b/csv2mdtable.1.html
@@ -79,7 +79,7 @@ EXAMPLES
cat data1.csv | csv2mdtable > data1.md
Convert data1.csv to data1.md using options.
csv2mdtable -i data1.csv -o data1.md
-csv2mdtable 1.2.11
+csv2mdtable 1.2.12
You can also search for phrases in columns.
csvfind -i books.csv -col=2 -contains "Red Book"
-csvfind 1.2.11
+csvfind 1.2.12
diff --git a/csvfind.1.md b/csvfind.1.md
index c8e91f62..0a3962da 100644
--- a/csvfind.1.md
+++ b/csvfind.1.md
@@ -1,6 +1,6 @@
-%csvfind(1) user manual | version 1.2.11 ff4493f
+%csvfind(1) user manual | version 1.2.12 1128bff
% R. S. Doiel
-% 2024-10-24
+% 2024-11-07
# NAME
@@ -117,5 +117,5 @@ You can also search for phrases in columns.
csvfind -i books.csv -col=2 -contains "Red Book"
~~~
-csvfind 1.2.11
+csvfind 1.2.12
diff --git a/csvjoin.1.html b/csvjoin.1.html
index 21683aa4..6aa5d79f 100644
--- a/csvjoin.1.html
+++ b/csvjoin.1.html
@@ -139,7 +139,7 @@ EXAMPLES
csvjoin -csv1=data1.csv -col1=2 \
-csv2=data2.csv -col2=4 \
-output=merged-data.csv
-csvjoin 1.2.11
+csvjoin 1.2.12
diff --git a/csvjoin.1.md b/csvjoin.1.md
index e4b3e92d..63c2b51b 100644
--- a/csvjoin.1.md
+++ b/csvjoin.1.md
@@ -1,6 +1,6 @@
-%csvjoin(1) user manual | version 1.2.11 ff4493f
+%csvjoin(1) user manual | version 1.2.12 1128bff
% R. S. Doiel
-% 2024-10-24
+% 2024-11-07
# NAME
@@ -105,6 +105,6 @@ merged-data.csv..
-output=merged-data.csv
~~~
-csvjoin 1.2.11
+csvjoin 1.2.12
diff --git a/csvrows.1.html b/csvrows.1.html
index 80ef2db5..1a0a229a 100644
--- a/csvrows.1.html
+++ b/csvrows.1.html
@@ -105,7 +105,7 @@ EXAMPLES
Filter 3 randomly selected rows from 10row.csv rendering new CSV with
a header row from 10row.csv.
csvrows -i 10row.csv -header=true -random=3
-csvrows 1.2.11
+csvrows 1.2.12