https://github.com/zeehio/mendeleyr
R Package that interfaces with Mendeley's API. Not official, not complete, not very supported (limited time). Patches welcome.
https://github.com/zeehio/mendeleyr
bibtex mendeley r
Last synced: 6 months ago
JSON representation
R Package that interfaces with Mendeley's API. Not official, not complete, not very supported (limited time). Patches welcome.
- Host: GitHub
- URL: https://github.com/zeehio/mendeleyr
- Owner: zeehio
- License: other
- Created: 2017-06-01T15:33:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-19T15:11:11.000Z (about 8 years ago)
- Last Synced: 2025-04-09T17:14:07.542Z (6 months ago)
- Topics: bibtex, mendeley, r
- Language: R
- Size: 42 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
title: "mendeleyr"
author: "Sergio Oller"
date: "`r Sys.Date()`"
output: rmarkdown::github_document
---mendeleyr provides a subset of the Mendeley API through R.
[](https://travis-ci.org/zeehio/mendeleyr)
[](https://codecov.io/github/zeehio/mendeleyr)## Browse source code
Checkout the code and browse it at
[http://github.com/zeehio/mendeleyr](http://github.com/zeehio/mendeleyr).## How to install mendeleyr:
### Package installation
* To install the latest development version:
```
devtools::install_github("zeehio/mendeleyr")
```## Quick start:
### Setup:
Mendeley's API is based on oAuth2. This means that `mendeleyr` should be registered
as an application in [http://dev.mendeley.com/myapps.html] and receive a `client_id`
and a `client_secret`. As `mendeleyr` is open source, the package can't provide
a secret so it is required that the `mendeleyr` user registers its own app.This is a one-time step, and it is very easy. `mdl_conf_new()` provides detailed
instructions on how to do that:```{r, error=TRUE}
library(mendeleyr)
mdl_conf_new()
```Once you have registered you app, you will be able to save the mendeley parameters
to a file, by default it is saved as `.mendeley_conf.json` in the current directory.```{r, eval=FALSE}
mdl_conf_save(client_id = "given-by-mendeley", client_secret = "given-by-mendeley",
where = ".mendeley_conf.json")
```Mendeley knows now that you are using `mendeleyr`. The final step is to grant
`mendeleyr` access to your account. The first time you run this, you will need
to login to Mendeley through the browser. Afterwards a token will be saved
so you don't have to login every time.```{r, eval = FALSE}
token <- mdl_token(".mendeley_conf.json")
```### Using mendeleyr
#### Export mendeley folders to a bibtex file:
```{r, eval = FALSE}
all_my_folders <- mdl_folders(token)
mdl_to_bibtex(token, folder_name = "my_folder", bibfile = "my_folder.bib")
```If the folder belongs to a group:
```{r, eval = FALSE}
mdl_to_bibtex(token, folder_name = "shared_folder", group_name = "my_group",
bibfile = "shared_folder.bib")
```#### List all documents in a folder:
```{r, eval = FALSE}
my_docs <- mdl_documents(token, folder_name = "my_folder")
```#### Download a file:
```{r, eval = FALSE}
my_docs <- mdl_documents(token, folder_name = "my_folder")
all_files <- mdl_files(token, document_id = my_docs$id[1])
mdl_download_file(token, all_files[1,])
```