Skip to content

Commit

Permalink
rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Apr 22, 2024
1 parent 3a00660 commit 4fed1f8
Show file tree
Hide file tree
Showing 23 changed files with 53 additions and 52 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Go Reference](https://pkg.go.dev/badge/github.com/front-matter/commonmeta.svg)](https://pkg.go.dev/github.com/front-matter/commonmeta)
[![Go Report Card](https://goreportcard.com/badge/github.com/front-matter/commonmeta)](https://goreportcard.com/report/github.com/front-matter/commonmeta)

# commonmeta-go
# commonmeta
commonmeta is a Go library to implement Commonmeta, the common Metadata Model for Scholarly Metadata. Use commonmeta to convert scholarly metadata, in a variety of formats, listed below. Commonmeta is work in progress, the first release was on April 19, 2024. Implementations in other languages are also available ([Ruby](https://github.com/front-matter/commonmeta-ruby), [Python](https://github.com/front-matter/commonmeta-py)).

commonmeta-go is a Go library to implement Commonmeta, the common Metadata Model for Scholarly Metadata. Use commonmeta-go to convert scholarly metadata, in a variety of formats, listed below. Commonmeta-go is work in progress, the first release was on April 19, 2024. Implementations in other languages are also available ([Ruby](https://github.com/front-matter/commonmeta-ruby), [Python](https://github.com/front-matter/commonmeta-py)).

commonmeta-go uses semantic versioning. Currently, its major version number is still at 0, meaning the API is not yet stable, and breaking changes are expected in the internal API and commonmeta JSON format.
commonmeta uses semantic versioning. Currently, its major version number is still at 0, meaning the API is not yet stable, and breaking changes are expected in the internal API and commonmeta JSON format.


## Supported Metadata Formats

Commonmeta-go reads and/or writes these metadata formats:
Commonmeta reads and/or writes these metadata formats:

| Format | Name | Content Type | Read | Write |
| ------------------------------------------------------------------------------------------------ | ------------- | -------------------------------------- | ------- | ------- |
Expand Down Expand Up @@ -37,6 +38,6 @@ _Later_: we plan to implement this format in a later release.

## Meta

Please note that this project is released with a [Contributor Code of Conduct](https://github.com/front-matter/commonmeta-go/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/front-matter/commonmeta/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

License: [MIT](https://github.com/front-matter/commonmeta-go/blob/main/LICENSE)
License: [MIT](https://github.com/front-matter/commonmeta/blob/main/LICENSE)
2 changes: 1 addition & 1 deletion cff/cff.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cff

import "commonmeta-go/types"
import "commonmeta/types"

type Content struct {
ID string `json:"id"`
Expand Down
8 changes: 4 additions & 4 deletions cmd/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"fmt"
"strings"

"commonmeta-go/datacite"
"commonmeta-go/doiutils"
"commonmeta-go/types"
"commonmeta/datacite"
"commonmeta/doiutils"
"commonmeta/types"

"commonmeta-go/crossref"
"commonmeta/crossref"

"github.com/spf13/cobra"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"encoding/json"
"fmt"

"commonmeta-go/commonmeta"
"commonmeta/commonmeta"

"commonmeta-go/crossref"
"commonmeta/crossref"

"commonmeta-go/datacite"
"commonmeta/datacite"

"commonmeta-go/types"
"commonmeta/types"

"github.com/spf13/cobra"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"encoding/json"
"fmt"

"commonmeta-go/commonmeta"
"commonmeta/commonmeta"

"commonmeta-go/crossref"
"commonmeta/crossref"

"commonmeta-go/datacite"
"commonmeta/datacite"

"commonmeta-go/types"
"commonmeta/types"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion codemeta/codemeta.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package codemeta

import "commonmeta-go/types"
import "commonmeta/types"

type Content struct {
ID string `json:"id"`
Expand Down
4 changes: 2 additions & 2 deletions commonmeta/commonmeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"encoding/json"
"fmt"

"commonmeta-go/schemautils"
"commonmeta-go/types"
"commonmeta/schemautils"
"commonmeta/types"

"github.com/xeipuuv/gojsonschema"
)
Expand Down
12 changes: 6 additions & 6 deletions crossref/crossref.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"strings"
"time"

"commonmeta-go/dateutils"
"commonmeta-go/doiutils"
"commonmeta-go/types"
"commonmeta-go/utils"
"commonmeta/dateutils"
"commonmeta/doiutils"
"commonmeta/types"
"commonmeta/utils"
)

type Content struct {
Expand Down Expand Up @@ -282,7 +282,7 @@ func GetCrossref(pid string) (Content, error) {
req, err := http.NewRequest("GET", url, nil)
v := "0.1"
u := "[email protected]"
userAgent := fmt.Sprintf("commonmeta-go/%s (https://commonmeta.org/commonmeta-go/; mailto: %s)", v, u)
userAgent := fmt.Sprintf("commonmeta/%s (https://commonmeta.org/; mailto: %s)", v, u)
req.Header.Set("User-Agent", userAgent)
if err != nil {
log.Fatalln(err)
Expand Down Expand Up @@ -585,7 +585,7 @@ func GetCrossrefList(number int, member string, _type string, sample bool, hasOR
req, err := http.NewRequest("GET", url, nil)
v := "0.1"
u := "[email protected]"
userAgent := fmt.Sprintf("commonmeta-go/%s (https://commonmeta.org; mailto: %s)", v, u)
userAgent := fmt.Sprintf("commonmeta/%s (https://commonmeta.org; mailto: %s)", v, u)
req.Header.Set("User-Agent", userAgent)
req.Header.Set("Cache-Control", "private")
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions crossref/crossref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
"testing"

"commonmeta-go/crossref"
"commonmeta-go/doiutils"
"commonmeta-go/types"
"commonmeta/crossref"
"commonmeta/doiutils"
"commonmeta/types"

"github.com/google/go-cmp/cmp"
)
Expand Down
2 changes: 1 addition & 1 deletion crossrefxml/crossrefxml.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package crossrefxml

import (
"commonmeta-go/types"
"commonmeta/types"
)

type Content struct {
Expand Down
2 changes: 1 addition & 1 deletion csl/csl.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package csl

import "commonmeta-go/types"
import "commonmeta/types"

type Content struct {
ID string `json:"id"`
Expand Down
8 changes: 4 additions & 4 deletions datacite/datacite.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"strings"
"time"

"commonmeta-go/constants"
"commonmeta-go/doiutils"
"commonmeta-go/types"
"commonmeta/constants"
"commonmeta/doiutils"
"commonmeta/types"

"commonmeta-go/utils"
"commonmeta/utils"
)

type Content struct {
Expand Down
6 changes: 3 additions & 3 deletions datacite/datacite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"strings"
"testing"

"commonmeta-go/datacite"
"commonmeta/datacite"

"commonmeta-go/doiutils"
"commonmeta-go/types"
"commonmeta/doiutils"
"commonmeta/types"

"github.com/google/go-cmp/cmp"
)
Expand Down
2 changes: 1 addition & 1 deletion dateutils/dateutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dateutils_test
import (
"testing"

"commonmeta-go/dateutils"
"commonmeta/dateutils"
)

// func TestGetDateParts(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion doiutils/doiutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package doiutils_test
import (
"testing"

"commonmeta-go/doiutils"
"commonmeta/doiutils"
)

func TestValidateDOI(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion inveniordm/inveniordm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"time"

"commonmeta-go/types"
"commonmeta/types"
)

type Content struct {
Expand Down
2 changes: 1 addition & 1 deletion inveniordm/inveniordm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package inveniordm_test
import (
"testing"

"commonmeta-go/inveniordm"
"commonmeta/inveniordm"
)

func TestGetInvenioRDM(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion jsonfeed/jsonfeed.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package jsonfeed

import (
"commonmeta-go/types"
"commonmeta/types"
"encoding/json"
"fmt"
"io"
Expand Down
2 changes: 1 addition & 1 deletion jsonfeed/jsonfeed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package jsonfeed_test
import (
"testing"

"commonmeta-go/jsonfeed"
"commonmeta/jsonfeed"
)

func TestGetJsonFeedItem(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion schemaorg/schemaorg.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package schemaorg

import "commonmeta-go/types"
import "commonmeta/types"

type Content struct {
ID string `json:"id"`
Expand Down
4 changes: 2 additions & 2 deletions schemautils/schemautils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"path/filepath"

"commonmeta-go/schemautils"
"commonmeta-go/types"
"commonmeta/schemautils"
"commonmeta/types"

"fmt"
"log"
Expand Down
2 changes: 1 addition & 1 deletion types/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package types_test
import (
"testing"

"commonmeta-go/types"
"commonmeta/types"
)

func TestMetadata(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion utils/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package utils_test
import (
"testing"

"commonmeta-go/utils"
"commonmeta/utils"
)

func TestNormalizeUrl(t *testing.T) {
Expand Down

0 comments on commit 4fed1f8

Please sign in to comment.