Skip to content
convert among citation formats
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
R
inst/extdata
man
tests
.Rbuildignore
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
DESCRIPTION
LICENSE
Makefile
NAMESPACE
NEWS.md
README.Rmd
README.md
appveyor.yml
cran-comments.md

README.md

handlr

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. cran checks Build Status Build status codecov.io rstudio mirror downloads cran version

a tool for converting among citation formats.

heavily influenced by, and code ported from https://github.com/datacite/bolognese

supported readers:

supported writers:

not supported yet, but plan to:

  • crosscite

Installation

stable version

install.packages("handlr")

dev version

devtools::install_github("ropensci/handlr")
library("handlr")

All in one

There's a single R6 interface to all readers and writers

z <- system.file("extdata/citeproc.json", package = "handlr")
x <- HandlrClient$new(x = z)
x
#> <handlr> 
#>   doi: 
#>   ext: json
#>   format (guessed): citeproc
#>   path: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/handlr/extdata/citeproc.json
#>   string (abbrev.): none

read the file

x$read(format = "citeproc")

the parsed content

x$parsed
#> $id
#> [1] "https://doi.org/10.5438/4k3m-nyvg"
#> 
#> $type
#> [1] "BlogPosting"
#> 
#> $additional_type
#> NULL
#> 
#> $citeproc_type
#> [1] "post-weblog"
#> 
#> $bibtex_type
#> [1] "article"
#> 
#> $ris_type
#> [1] "GEN"
#> 
#> $doi
#> [1] "10.5438/4k3m-nyvg"
...

write out bibtex

cat(x$write("bibtex"), sep = "\n")
#> @article{https://doi.org/10.5438/4k3m-nyvg,
#>   doi = {10.5438/4k3m-nyvg},
#>   author = {Martin Fenner},
#>   title = {Eating your own Dog Food},
#>   journal = {DataCite Blog},
#>   pages = {},
#>   publisher = {DataCite},
#>   year = {2016},
#> }

Choose your own adventure

Instead of using the HandlrClient, you can use the regular functions for each reader or writer. They are:

  • citeproc_reader() / citeproc_writer()
  • ris_reader() / ris_writer()
  • bibtex_reader() / bibtex_writer()
  • codemeta_reader() / codemeta_writer()
  • schema_org_writer()
  • rdf_xml_writer()

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for handlr in R doing citation(package = 'handlr')
  • 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.

ropensci_footer

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.