knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

library(yq)

yq: An R client to access 'YuQue' API

Lifecycle: experimental AppVeyor build status Travis build status Codecov test coverage

Installation

You can install the development version of yq from GitHub with:

remotes::install_github("openbiox/yq")

Configuration

Firstly, you should let YuQue know who you are by running yq_config(). You will need to answer some questions.

> library(yq)
> yq_config()
Please type your login name of YuQue: 
(type e to exit) shixiangwang
Do you want to input token? 
(type ENTER to proceed) 
Please type your token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Found token, checking it...
Saving info to ~/.yuque.json
Updating login
Updating token
Done. Enjoy this tool.
- Shixiang

Next, you can run yq_whoami() to check if your profile is right.

> yq_whoami()
type                : User
id                  : 471931
login               : shixiangwang
name                : 王诗翔
description         : https://shixiangwang.github.io/home/
books_count         : 3
public_books_count  : 2
followers_count     : 0
following_count     : 0
created_at          : 2019-09-01T09:21:50.000Z
updated_at          : 2019-09-03T06:43:10.000Z
limits              : 49899

The token can be obtained from YuQue account. More please run ?yq_whoami to see documentation.

Usage

Main API

The main API of yq package is yq() function. You can send any queries to YuQue API URL https://www.yuque.com/api/v2 or set custom API URL by .api_url argument. All user functions are built on the top of yq().

args(yq)

User functions

This package is under heavy development, many features shown in YuQue API have not yet implemented. I will give a short intro to functions available.

Show cases

yq_list_groups()
yq_list_groups(verbose = "all")
yq_list_public_groups()
yq_list_group_info(login = "elegant-r")

Code of Conduct

Please note that the 'yq' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



ShixiangWang/yq documentation built on Oct. 30, 2019, 11:57 p.m.