All Projects → sckott → serrano

sckott / serrano

Licence: MIT License
Low level Ruby client for Crossref

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to serrano

isbnlib
python library to validate, clean, transform and get metadata of ISBN strings (for devs).
Stars: ✭ 177 (+580.77%)
Mutual labels:  metadata, doi
CommitCombo
깃허브 커밋 기록을 아름답게 꾸미는 프로젝트 ⭐
Stars: ✭ 31 (+19.23%)
Mutual labels:  metadata
go-xmp
A native Go SDK for the Extensible Metadata Platform (XMP)
Stars: ✭ 36 (+38.46%)
Mutual labels:  metadata
gutenberg-metadata
Metadata from Project Gutenberg
Stars: ✭ 24 (-7.69%)
Mutual labels:  metadata
timber-ruby
🌲 Great Ruby logging made easy.
Stars: ✭ 155 (+496.15%)
Mutual labels:  metadata
columbus
Metadata storage service
Stars: ✭ 42 (+61.54%)
Mutual labels:  metadata
openmrs-module-initializer
The OpenMRS Initializer module is an API-only module that processes the content of the configuration folder when it is found inside OpenMRS' application data directory.
Stars: ✭ 18 (-30.77%)
Mutual labels:  metadata
rdryad
R client for Dryad web services
Stars: ✭ 25 (-3.85%)
Mutual labels:  doi
skyrim
The Skyrim masterlist.
Stars: ✭ 68 (+161.54%)
Mutual labels:  metadata
skyrimse
The TES V: Skyrim Special Edition masterlist.
Stars: ✭ 99 (+280.77%)
Mutual labels:  metadata
Awesome-Image-Gallery-Android
Open source Image Gallery with tons of feature .
Stars: ✭ 22 (-15.38%)
Mutual labels:  metadata
TEAM
The Taxonomy for ETL Automation Metadata (TEAM) is a metadata management tool for data warehouse automation. It is part of the ecosystem for data warehouse automation, alongside the Virtual Data Warehouse pattern manager and the generic schema for Data Warehouse Automation.
Stars: ✭ 27 (+3.85%)
Mutual labels:  metadata
Kvpbase
Scalable, simple RESTful object storage platform, written in C#
Stars: ✭ 43 (+65.38%)
Mutual labels:  metadata
PHES-ODM
Metadata and code to support covid-19 wastewater surveillance and open science.
Stars: ✭ 34 (+30.77%)
Mutual labels:  metadata
biblio-glutton
A high performance bibliographic information service
Stars: ✭ 54 (+107.69%)
Mutual labels:  doi
HiGitClass
HiGitClass: Keyword-Driven Hierarchical Classification of GitHub Repositories (ICDM'19)
Stars: ✭ 58 (+123.08%)
Mutual labels:  metadata
replica
Replica, the id3 metadata cloner
Stars: ✭ 13 (-50%)
Mutual labels:  metadata
roda
RODA - Repository of Authentic Digital Objects
Stars: ✭ 54 (+107.69%)
Mutual labels:  metadata
peppy
Project metadata manager for PEPs in Python
Stars: ✭ 29 (+11.54%)
Mutual labels:  metadata
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (-3.85%)
Mutual labels:  metadata

serrano

gem version Ruby codecov.io DOI Ruby Style Guide

serrano is a low level client for Crossref APIs

Docs: https://www.rubydoc.info/gems/serrano

Other Crossref API clients:

Crossref's API issue tracker: https://gitlab.com/crossref/issues

Changes

For changes see the Changelog

API

Methods in relation to Crossref search API routes

  • /works - Serrano.works()
  • /members - Serrano.members()
  • /prefixes - Serrano.prefixes()
  • /funders - Serrano.funders()
  • /journals - Serrano.journals()
  • /licenses - Serrano.licenses()
  • /types - Serrano.types()

Additional methods built on top of the Crossref search API:

  • DOI minting agency - Serrano.registration_agency()
  • Get random DOIs - Serrano.random_dois()

Other methods:

Note about searching:

You are using the Crossref search API described at https://api.crossref.org When you search with query terms, on Crossref servers they are not searching full text, or even abstracts of articles, but only what is available in the data that is returned to you. That is, they search article titles, authors, etc. For some discussion on this, see https://gitlab.com/crossref/issues/issues/101

Rate limits:

Crossref introduced rate limiting recently. The rate limits apparently vary, so we can't give a predictable rate limit. As of this writing, the rate limit is 50 requests per second. Look for the headers X-Rate-Limit-Limit and X-Rate-Limit-Interval in requests to see what the current rate limits are.

The Polite Pool:

To get in the polite pool it's a good idea now to include a mailto email address. See docs for more information. TLDR: set your email in an env var CROSSREF_EMAIL.

URL Encoding:

We do URL encoding of DOIs for you for all methods except Serrano.citation_count which doesn't work if you encode DOIs beforehand. We use ERB::Util.url_encode to encode.

Install

Release version

gem install serrano

Development version

git clone [email protected]:sckott/serrano.git
cd serrano
rake install

Setup

Crossref's API will likely be used by others in the future, allowing the base URL to be swapped out. You can swap out the base URL by passing named options in a block to Serrano.configuration.

This will also be the way to set up other user options, as needed down the road.

Serrano.configuration do |config|
  config.base_url = "https://api.crossref.org"
end

We recommend you set your mailto email here so you can get in the "polite pool" which gives you faster rate limits:

Serrano.configuration do |config|
  config.mailto = "[email protected]"
end

Or use an env var with name CROSSREF_EMAIL

Examples

Use in a Ruby repl

Search works by DOI

require 'serrano'
Serrano.works(ids: '10.1371/journal.pone.0033693')

Search works by query string

Serrano.works(query: "ecology")

Search works using metadata filters. See CrossRef filter docs.

Serrano.works(query: "ecology", filter: { has_abstract: true })

Search journals by publisher name

Serrano.journals(query: "peerj")

Search funding information by DOI

Serrano.funders(ids: ['10.13039/100000001','10.13039/100000015'])

Get agency for a set of DOIs

Serrano.registration_agency(ids: ['10.1007/12080.1874-1746','10.1007/10452.1573-5125'])

Get random set of DOIs

Serrano.random_dois(sample: 100)

Content negotiation

Serrano.content_negotiation(ids: '10.1126/science.169.3946.635', format: "citeproc-json")

Use on the CLI

The command line tool serrano should be available after you install

~$ serrano
Commands:
  serrano contneg                   # Content negotiation
  serrano funders [funder IDs]      # Search for funders by DOI prefix
  serrano help [COMMAND]            # Describe available commands or one spec...
  serrano journals [journal ISSNs]  # Search for journals by ISSNs
  serrano licenses                  # Search for licenses by name
  serrano members [member IDs]      # Get members by id
  serrano prefixes [DOI prefixes]   # Search for prefixes by DOI prefix
  serrano types [type name]         # Search for types by name
  serrano version                   # Get serrano version
  serrano works [DOIs]              # Get works by DOIs
# A single DOI
~$ serrano works 10.1371/journal.pone.0033693

# Many DOIs
~$ serrano works "10.1007/12080.1874-1746,10.1007/10452.1573-5125"

# output JSON, then parse with e.g., jq
~$ serrano works --filter=has_orcid:true --json --limit=2 | jq '.message.items[].author[].ORCID | select(. != null)'

Meta

  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
  • License: MIT
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].