Skip to content

Commit f838334

Browse files
author
R. S. Doiel
committed
prep for v1.2.12 release
1 parent 1128bff commit f838334

File tree

104 files changed

+185
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+185
-150
lines changed

CITATION.cff

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ maintainers:
1515
orcid: "https://orcid.org/0000-0003-0900-6903"
1616

1717
repository-code: "https://github.com/caltechlibrary/datatools"
18-
version: 1.2.11
18+
version: 1.2.12
1919
license-url: "https://data.caltech.edu/license"
2020
keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]

Makefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ RELEASE_DATE=$(shell date +'%Y-%m-%d')
99

1010
RELEASE_HASH=$(shell git log --pretty=format:'%h' -n 1)
1111

12-
1312
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
1413

1514
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
4847
--template codemeta-version-go.tmpl \
4948
LICENSE >version.go
5049

51-
52-
53-
5450
about.md: codemeta.json .FORCE
5551
cat codemeta.json | sed -E 's/"@context"/"at__context"/g;s/"@type"/"at__type"/g;s/"@id"/"at__id"/g' >_codemeta.json
5652
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
218214

219215
snap: dist/datatools_$(VERSION)_amd64.snap
220216

221-
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
217+
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
222218

223219

224220
.FORCE:

about.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<section>
2727
<h1 id="about-this-software">About this software</h1>
28-
<h2 id="datatools-1.2.11">datatools 1.2.11</h2>
28+
<h2 id="datatools-1.2.12">datatools 1.2.12</h2>
2929
<h3 id="authors">Authors</h3>
3030
<ul>
3131
<li>R. S. Doiel</li>

about.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors:
1111
orcid: "https://orcid.org/0000-0003-0900-6903"
1212

1313
repository-code: "https://github.com/caltechlibrary/datatools"
14-
version: 1.2.11
14+
version: 1.2.12
1515
license-url: "https://data.caltech.edu/license"
1616
keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]
1717

@@ -20,7 +20,7 @@ keywords: [ "csv", "excel", "sql", "json", "yaml", "xlsx", "golang", "bash" ]
2020
About this software
2121
===================
2222

23-
## datatools 1.2.11
23+
## datatools 1.2.12
2424

2525
### Authors
2626

codemeta.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"license": "https://data.caltech.edu/license",
55
"codeRepository": "https://github.com/caltechlibrary/datatools",
66
"dateCreated": "2017-02-06",
7-
"dateRelease": "2024-10-24",
8-
"dateModified": "2024-10-24",
7+
"dateRelease": "2024-11-07",
8+
"dateModified": "2024-11-07",
99
"downloadUrl": "https://github.com/caltechlibrary/datatools/releases/",
1010
"issueTracker": "https://github.com/caltechlibrary/datatools/issues",
1111
"name": "datatools",
12-
"version": "1.2.11",
12+
"version": "1.2.12",
1313
"description": "A set of command line tools for working with CSV, Excel Workbooks, JSON and structured text documents.",
14-
"releaseNotes": "fix isssue#21, CopyrightYear is an int",
14+
"releaseNotes": "fix issue #22, identifying DOI without http prefix",
1515
"applicationCategory": "computer programming",
1616
"developmentStatus": "active",
1717
"funder": {

codemeta/codemeta.go

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import (
77

88
// Caltech Library package
99
"github.com/caltechlibrary/doitools"
10+
11+
// 3rd Party Package
12+
"github.com/hscells/doi"
1013
)
1114

1215
type PersonOrOrganization struct {
@@ -53,6 +56,7 @@ type Codemeta struct {
5356
// Additional codemeta Terms are defined at https://codemeta.github.io/terms/
5457
}
5558

59+
5660
func (person *PersonOrOrganization) ToJSON() ([]byte, error) {
5761
return JSONMarshalIndent(person, "", "\t")
5862
}
@@ -71,6 +75,15 @@ func (person *PersonOrOrganization) ToCFF() ([]byte, error) {
7175
orcid: %s`, person.FamilyName, person.GivenName, person.Id)), nil
7276
}
7377

78+
// Check if identifier is a DOI
79+
func isDOI(identifier string) bool {
80+
doi, err := doi.Parse(identifier)
81+
if err != nil {
82+
return false
83+
}
84+
return doi.IsValid()
85+
}
86+
7487
// ToCff crosswalks a Codemeta data structure rendering
7588
// CITATION.cff document as an array of byte.
7689
// Based on documentation at https://citation-file-format.github.io/
@@ -96,7 +109,7 @@ repository-code: %q`, cm.CodeRepository))...)
96109
src = append(src, []byte(`
97110
type: software`)...)
98111
}
99-
if strings.HasPrefix(cm.Identifier, "https://doi.org/") {
112+
if isDOI(cm.Identifier) {
100113
if doi, err := doitools.NormalizeDOI(cm.Identifier); err == nil {
101114
src = append(src, []byte(fmt.Sprintf(`
102115
doi: %s`, doi))...)

codemeta/codemeta_test.go

+17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ import (
44
"testing"
55
)
66

7+
func TestIsDOI(t *testing.T) {
8+
identifier := "10.22002/5rbqw-9cc91"
9+
expected := true
10+
got := isDOI(identifier)
11+
if expected != got {
12+
t.Errorf("for %q, expected %t, got %t", identifier, expected, got)
13+
}
14+
identifier = "0000-1111-2222-3333"
15+
expected = false
16+
got = isDOI(identifier)
17+
if expected != got {
18+
t.Errorf("for %q, expected %t, got %t", identifier, expected, got)
19+
}
20+
21+
22+
}
23+
724
func TestCodemeta(t *testing.T) {
825
t.Errorf("TestCodemeta() not implemented.")
926
}

codemeta2cff.1.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%codemeta2cff(1) user manual | version 1.2.11 ff4493f
1+
%codemeta2cff(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

csv2json.1.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2json(1) user manual | version 1.2.11 ff4493f
1+
%csv2json(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

csv2mdtable.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ <h1 id="examples">EXAMPLES</h1>
7979
<pre><code> cat data1.csv | csv2mdtable &gt; data1.md</code></pre>
8080
<p>Convert data1.csv to data1.md using options.</p>
8181
<pre><code> csv2mdtable -i data1.csv -o data1.md</code></pre>
82-
<p>csv2mdtable 1.2.11</p>
82+
<p>csv2mdtable 1.2.12</p>
8383
</section>
8484

8585
<footer>

csv2mdtable.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2mdtable(1) user manual | version 1.2.11 ff4493f
1+
%csv2mdtable(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -62,6 +62,6 @@ Convert data1.csv to data1.md using options.
6262
csv2mdtable -i data1.csv -o data1.md
6363
~~~
6464

65-
csv2mdtable 1.2.11
65+
csv2mdtable 1.2.12
6666

6767

csv2tab.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h1 id="examples">EXAMPLES</h1>
5656
<p>This would yield</p>
5757
<pre><code> name email age
5858
Doe, Jane [email protected] 42</code></pre>
59-
<p>csv2tab 1.2.11</p>
59+
<p>csv2tab 1.2.12</p>
6060
</section>
6161

6262
<footer>

csv2tab.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2tab(1) user manual | version 1.2.11 ff4493f
1+
%csv2tab(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -49,6 +49,6 @@ This would yield
4949
Doe, Jane [email protected] 42
5050
~~~
5151

52-
csv2tab 1.2.11
52+
csv2tab 1.2.12
5353

5454

csv2xlsx.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ <h1 id="examples">EXAMPLES</h1>
8686
<pre><code> cat data.csv | csv2xlsx MyWorkbook.xlsx &#39;My worksheet 2&#39;</code></pre>
8787
<p>This does the same but the contents of data.csv are piped into the
8888
workbook’s ‘My worksheet 2’ sheet.</p>
89-
<p>csv2xlsx 1.2.11</p>
89+
<p>csv2xlsx 1.2.12</p>
9090
</section>
9191

9292
<footer>

csv2xlsx.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csv2xlsx(1) user manual | version 1.2.11 ff4493f
1+
%csv2xlsx(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -69,6 +69,6 @@ called 'MyWorkbook.xlsx' with the contents of data.csv.
6969
This does the same but the contents of data.csv are piped into
7070
the workbook's 'My worksheet 2' sheet.
7171

72-
csv2xlsx 1.2.11
72+
csv2xlsx 1.2.12
7373

7474

csvcleaner.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ <h1 id="examples">EXAMPLES</h1>
127127
<pre><code> cat mysheet.csv | csvcleaner -right-trim</code></pre>
128128
<p>Trim leading and trailing spaces from output.</p>
129129
<pre><code> cat mysheet.csv | csvcleaner -trim-space</code></pre>
130-
<p>csvcleaner 1.2.11</p>
130+
<p>csvcleaner 1.2.12</p>
131131
</section>
132132

133133
<footer>

csvcleaner.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csvcleaner(1) user manual | version 1.2.11 ff4493f
1+
%csvcleaner(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -107,5 +107,5 @@ Trim leading and trailing spaces from output.
107107
cat mysheet.csv | csvcleaner -trim-space
108108
~~~
109109

110-
csvcleaner 1.2.11
110+
csvcleaner 1.2.12
111111

csvcols.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ <h1 id="examples">EXAMPLES</h1>
103103
<p>Using options filter a 3 column CSV file for columns 1,3 into
104104
2col.csv</p>
105105
<pre><code> csvcols -i 3col.csv -col 1,3 -o 2col.csv</code></pre>
106-
<p>csvcols 1.2.11</p>
106+
<p>csvcols 1.2.12</p>
107107
</section>
108108

109109
<footer>

csvcols.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csvcols(1) user manual | version 1.2.11 ff4493f
1+
%csvcols(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -90,6 +90,6 @@ Using options filter a 3 column CSV file for columns 1,3 into 2col.csv
9090
csvcols -i 3col.csv -col 1,3 -o 2col.csv
9191
~~~
9292

93-
csvcols 1.2.11
93+
csvcols 1.2.12
9494

9595

csvfind.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h1 id="examples">EXAMPLES</h1>
141141
matches are.</p>
142142
<p>You can also search for phrases in columns.</p>
143143
<pre><code> csvfind -i books.csv -col=2 -contains &quot;Red Book&quot;</code></pre>
144-
<p>csvfind 1.2.11</p>
144+
<p>csvfind 1.2.12</p>
145145
</section>
146146

147147
<footer>

csvfind.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csvfind(1) user manual | version 1.2.11 ff4493f
1+
%csvfind(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -117,5 +117,5 @@ You can also search for phrases in columns.
117117
csvfind -i books.csv -col=2 -contains "Red Book"
118118
~~~
119119

120-
csvfind 1.2.11
120+
csvfind 1.2.12
121121

csvjoin.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ <h1 id="examples">EXAMPLES</h1>
139139
<pre><code> csvjoin -csv1=data1.csv -col1=2 \
140140
-csv2=data2.csv -col2=4 \
141141
-output=merged-data.csv</code></pre>
142-
<p>csvjoin 1.2.11</p>
142+
<p>csvjoin 1.2.12</p>
143143
</section>
144144

145145
<footer>

csvjoin.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csvjoin(1) user manual | version 1.2.11 ff4493f
1+
%csvjoin(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -105,6 +105,6 @@ merged-data.csv..
105105
-output=merged-data.csv
106106
~~~
107107

108-
csvjoin 1.2.11
108+
csvjoin 1.2.12
109109

110110

csvrows.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ <h1 id="examples">EXAMPLES</h1>
105105
<p>Filter 3 randomly selected rows from 10row.csv rendering new CSV with
106106
a header row from 10row.csv.</p>
107107
<pre><code> csvrows -i 10row.csv -header=true -random=3</code></pre>
108-
<p>csvrows 1.2.11</p>
108+
<p>csvrows 1.2.12</p>
109109
</section>
110110

111111
<footer>

csvrows.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%csvrows(1) user manual | version 1.2.11 ff4493f
1+
%csvrows(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -96,6 +96,6 @@ a header row from 10row.csv.
9696
csvrows -i 10row.csv -header=true -random=3
9797
~~~
9898

99-
csvrows 1.2.11
99+
csvrows 1.2.12
100100

101101

finddir.1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h1 id="options">OPTIONS</h1>
9090
<h1 id="examples">EXAMPLES</h1>
9191
<p>Find all subdirectories starting with “img”.</p>
9292
<pre><code> finddir -p img</code></pre>
93-
<p>finddir 1.2.11</p>
93+
<p>finddir 1.2.12</p>
9494
</section>
9595

9696
<footer>

finddir.1.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
%finddir(1) user manual | version 1.2.11 ff4493f
1+
%finddir(1) user manual | version 1.2.12 1128bff
22
% R. S. Doiel
3-
% 2024-10-24
3+
% 2024-11-07
44

55
# NAME
66

@@ -65,5 +65,5 @@ Find all subdirectories starting with "img".
6565
finddir -p img
6666
~~~
6767

68-
finddir 1.2.11
68+
finddir 1.2.12
6969

0 commit comments

Comments
 (0)