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

ravelRy

Travis build status

ravelRy is an R package that provides access to the Ravelry API.

Ravelry describes itself as a place for knitters, crocheters, designers, spinners, weavers and dyers to keep track of their yarn, tools, project and pattern information, and look to others for ideas and inspiration.

Hex sticker yarn icon by Eucalyp via Flaticon.

Installation

You can install the development version of ravelRy from Github:

devtools::install_github("walkerkq/ravelRy")

Or the release via CRAN:

install.packages("ravelRy")

Getting started

  1. Set up a Ravelry developer account at https://www.ravelry.com/pro/developer.
  2. Create an app with basic authentication: read only access.
  3. Set RAVELRY_USERNAME and RAVELRY_PASSWORD in your .renviron file or via the console with the ravelry_auth() function.
library(ravelRy)

ravelry_auth(key = 'username') 
# you will be prompted to enter your username via the console

ravelry_auth(key = 'password') 
# you will be prompted to enter your password via the console

An example

Retrieve a list of free patterns for baby hats.

library(ravelRy)

search_results <- search_patterns(query = 'hat', page_size = 5, availability = 'free', fit = 'baby')
str(search_results, max.level = 1)

Get pattern details for those ids.

patterns <- get_patterns(ids = search_results$id)
str(patterns, max.level = 1)

More examples can be found here.



walkerkq/ravelRy documentation built on March 8, 2020, 8:31 a.m.