Git Product home page Git Product logo

ravelry's Introduction

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 with:

devtools::install_github("walkerkq/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')
ravelry_auth(key = 'password')

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')
search_results
#> # A tibble: 5 x 7
#>   free      id name    permalink  designer.id designer.name pattern_sources
#>   <lgl>  <int> <chr>   <chr>            <int> <chr>         <list>         
#> 1 TRUE  124400 Sockhe… sockhead-…       21767 Kelly McClure <df[,59] [3 × …
#> 2 TRUE  464893 Garter… garter-ea…       40686 Purl Soho     <df[,59] [1 × …
#> 3 TRUE  991743 Done i… done-in-o…       57164 Jennifer Pio… <df[,59] [2 × …
#> 4 TRUE  528611 Classi… classic-c…       40686 Purl Soho     <df[,59] [2 × …
#> 5 TRUE  585110 Quick … quick-omb…       82906 Emily Dormier <df[,59] [1 × …

Get pattern details for those ids.

patterns <- get_patterns(ids = search_results$id)
patterns
#> # A tibble: 5 x 50
#>   comments_count created_at currency difficulty_aver… difficulty_count
#>            <int> <chr>      <chr>               <dbl>            <int>
#> 1            156 2009/05/2… ""                   1.52             4887
#> 2             89 2014/01/2… "USD"                2.41             2449
#> 3             23 2014/10/2… "USD"                1.84             1158
#> 4             76 2015/06/0… ""                   2.21              712
#> 5              1 2020/01/0… "USD"                2.25                4
#> # … with 45 more variables: downloadable <lgl>, favorites_count <int>,
#> #   free <lgl>, gauge <chr>, gauge_divisor <int>, gauge_pattern <chr>,
#> #   generally_available <chr>, id <int>, name <chr>, pdf_url <chr>,
#> #   permalink <chr>, price <chr>, projects_count <int>, published <chr>,
#> #   queued_projects_count <int>, rating_average <dbl>, rating_count <int>,
#> #   row_gauge <chr>, updated_at <chr>, url <chr>, yardage <int>,
#> #   yardage_max <int>, personal_attributes <chr>, sizes_available <chr>,
#> #   product_id <chr>, currency_symbol <chr>, ravelry_download <lgl>,
#> #   download_location <list>, pdf_in_library <lgl>,
#> #   volumes_in_library <chr>, gauge_description <chr>,
#> #   yarn_weight_description <chr>, yardage_description <chr>,
#> #   pattern_needle_sizes <list>, notes_html <chr>, notes <chr>,
#> #   packs <list>, printings <list>, yarn_weight <list>, craft <list>,
#> #   pattern_categories <list>, pattern_attributes <list>,
#> #   pattern_author <list>, photos <list>, pattern_type <list>

More examples can be found here.

ravelry's People

Contributors

walkerkq avatar

Watchers

Gábor Csárdi avatar James Cloos avatar CRAN robot avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.