{"id":16702426,"url":"https://github.com/ropensci/oai","last_synced_at":"2025-03-21T20:32:03.694Z","repository":{"id":33689640,"uuid":"37342428","full_name":"ropensci/oai","owner":"ropensci","description":"OAI-PMH R client","archived":false,"fork":false,"pushed_at":"2022-11-10T16:47:07.000Z","size":489,"stargazers_count":14,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-20T00:00:58.687Z","etag":null,"topics":["data-access","oai-pmh","peer-reviewed","r","r-package","rstats","scholarly-api"],"latest_commit_sha":null,"homepage":"https://docs.ropensci.org/oai","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ropensci.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-12T20:14:33.000Z","updated_at":"2023-07-24T01:40:23.000Z","dependencies_parsed_at":"2023-01-15T02:04:52.591Z","dependency_job_id":null,"html_url":"https://github.com/ropensci/oai","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Foai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Foai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Foai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ropensci%2Foai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ropensci","download_url":"https://codeload.github.com/ropensci/oai/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221818275,"owners_count":16885712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-access","oai-pmh","peer-reviewed","r","r-package","rstats","scholarly-api"],"created_at":"2024-10-12T19:04:41.045Z","updated_at":"2024-10-28T10:44:34.347Z","avatar_url":"https://github.com/ropensci.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options: \n  chunk_output_type: console\n---\n\n```{r echo=FALSE}\nknitr::opts_chunk$set(\n  warning = FALSE,\n  message = FALSE,\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  cache.path = \"inst/cache/\"\n)\n```\n\n# `oai`: General Purpose 'Oai-PMH' Services Client \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=\"20%\" /\u003e\n\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![R-check](https://github.com/ropensci/oai/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/oai/actions/workflows/R-CMD-check.yaml)\n[![cran checks](https://cranchecks.info/badges/worst/oai)](https://cranchecks.info/pkgs/oai)\n[![codecov.io](https://codecov.io/github/ropensci/oai/coverage.svg?branch=master)](https://codecov.io/github/ropensci/oai?branch=master) \n[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/oai?color=2ED968)](https://github.com/r-hub/cranlogs.app) \n[![cran version](https://www.r-pkg.org/badges/version/oai)](https://cran.r-project.org/package=oai) \n[![](https://badges.ropensci.org/19_status.svg)](https://github.com/ropensci/software-review/issues/19)\n\n`oai` is an R client to work with OAI-PMH (Open Archives Initiative Protocol for Metadata Harvesting) services, a protocol developed by the Open Archives Initiative (https://en.wikipedia.org/wiki/Open_Archives_Initiative). OAI-PMH uses XML data format transported over HTTP.\n\nOAI-PMH Info:\n\n* Wikipedia (https://en.wikipedia.org/wiki/Open_Archives_Initiative_Protocol_for_Metadata_Harvesting)\n* OAI V2 specification (http://www.openarchives.org/OAI/openarchivesprotocol.html)\n\n`oai` is built on `xml2` and `httr`. In addition, we give back data.frame's whenever possible to make data comprehension, manipulation, and visualization easier. We also have functions to fetch a large directory of OAI-PMH services - it isn't exhaustive, but does contain a lot.\n\nOAI-PMH instead of paging with e.g., `page` and `per_page` parameters, uses (optionally) `resumptionTokens`, optionally with an expiration date. These tokens can be used to continue on to the next chunk of data, if the first request did not get to the end. Often, OAI-PMH services limit each request to 50 records, but this may vary by provider, I don't know for sure. The API of this package is such that we `while` loop for you internally until we get all records. We may in the future expose e.g., a `limit` parameter so you can say how many records you want, but we haven't done this yet.\n\n## Install\n\nInstall from CRAN\n\n```{r eval=FALSE}\ninstall.packages(\"oai\")\n```\n\nDevelopment version\n\n```{r eval=FALSE}\ndevtools::install_github(\"ropensci/oai\")\n```\n\n```{r pkg-load}\nlibrary(\"oai\")\n```\n\n## Identify\n\n```{r identify}\nid(\"http://oai.datacite.org/oai\")\n```\n\n## ListIdentifiers\n\n```{r list-identifiers}\nlist_identifiers(from = '2018-05-01T', until = '2018-06-01T')\n```\n\n## Count Identifiers\n\n```{r count-identifiers, cache=TRUE}\ncount_identifiers()\n```\n\n## ListRecords\n\n```{r list-records}\nlist_records(from = '2018-05-01T', until = '2018-05-15T')\n```\n\n## GetRecords\n\n```{r get-records}\nids \u003c- c(\"87832186-00ea-44dd-a6bf-c2896c4d09b4\", \"d981c07d-bc43-40a2-be1f-e786e25106ac\")\nget_records(ids)\n```\n\n## List MetadataFormats\n\n```{r list-metadataformats}\nlist_metadataformats(id = \"87832186-00ea-44dd-a6bf-c2896c4d09b4\")\n```\n\n## List Sets\n\n```{r list-sets}\nlist_sets(\"http://api.gbif.org/v1/oai-pmh/registry\")\n```\n\n## Examples of other OAI providers\n\n### Biodiversity Heritage Library\n\nIdentify\n\n```{r bhl-identify}\nid(\"http://www.biodiversitylibrary.org/oai\")\n```\n\nGet records\n\n```{r bhl-get-records}\nget_records(c(\"oai:biodiversitylibrary.org:item/7\", \"oai:biodiversitylibrary.org:item/9\"),\n            url = \"http://www.biodiversitylibrary.org/oai\")\n```\n\n\n## Acknowledgements\n\nMichał Bojanowski thanks National Science Centre for support through grant 2012/07/D/HS6/01971.\n\n\n## Meta\n\n* Please [report any issues or bugs](https://github.com/ropensci/oai/issues).\n* License: MIT\n* Get citation information for `oai` in R doing `citation(package = 'oai')`\n* Please note that this project is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By participating in this project you agree to abide by its terms.\n\n```{r logo, include = FALSE, eval = FALSE}\nlibrary(hexSticker)\nlibrary(magick)\ndownload.file(\n  \"https://wiki.epc.ub.uu.se/download/thumbnails/34212946/images.png?version=1\u0026modificationDate=1511952524492\u0026api=v2\",\n  dest = fig \u003c- tempfile()\n)\n\nimage_read(fig) |\u003e\n  image_crop(geometry = \"x90%\") |\u003e\n  image_write(path = fig2 \u003c- tempfile())\n\nsticker(\n  fig2,\n  package = \"oai\",\n  url = \"https://docs.ropensci.org/oai/\",\n  s_x = 1,\n  s_y = 0.83, \n  s_width = 0.7,\n  p_size = 25,\n  p_y = 1.5,\n  u_color = \"#ffffff\",\n  u_size = 5,\n  h_fill = \"#0C0F2E\",\n  h_color = \"black\",\n  filename = \"man/figures/logo.png\"\n)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Foai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fropensci%2Foai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fropensci%2Foai/lists"}