All Projects → r-lib → Gargle

r-lib / Gargle

Licence: other
Infrastructure for calling Google APIs from R, including auth

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Gargle

Ngx Auth Firebaseui
Angular Material UI component for firebase authentication
Stars: ✭ 518 (+488.64%)
Mutual labels:  google, authentication
Nativescript Plugin Firebase
🔥 NativeScript plugin for Firebase
Stars: ✭ 990 (+1025%)
Mutual labels:  google, authentication
Usethis
Set up commonly used 📦 components
Stars: ✭ 613 (+596.59%)
Mutual labels:  package, rstats
Laravel Acl
This package helps you to associate users with permissions and permission groups with laravel framework
Stars: ✭ 404 (+359.09%)
Mutual labels:  package, authentication
Google Auth Library Nodejs
🔑 Google Auth Library for Node.js
Stars: ✭ 1,094 (+1143.18%)
Mutual labels:  google, authentication
Micro Auth
A microservice that makes adding authentication with Google and Github to your application easy.
Stars: ✭ 466 (+429.55%)
Mutual labels:  google, authentication
Tidymv
Tidy Model Visualisation for Generalised Additive Models
Stars: ✭ 25 (-71.59%)
Mutual labels:  package, rstats
Goth
Elixir package for Oauth authentication via Google Cloud APIs
Stars: ✭ 191 (+117.05%)
Mutual labels:  google, authentication
Svelte Social Auth
Social Auth for Svelte v3
Stars: ✭ 86 (-2.27%)
Mutual labels:  google, authentication
Espresso
🚚 Espresso is an express delivery tracking app designed with Material Design style, built on MVP(Model-View-Presenter) architecture with RxJava2, Retrofit2, Realm database and ZXing
Stars: ✭ 1,084 (+1131.82%)
Mutual labels:  google, package
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (+281.82%)
Mutual labels:  google, authentication
Pkgsearch
Search R packages on CRAN
Stars: ✭ 73 (-17.05%)
Mutual labels:  package, rstats
Flutter Ui Nice
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.
Stars: ✭ 3,092 (+3413.64%)
Mutual labels:  google, package
Cloudfront Auth
An AWS CloudFront [email protected] function to authenticate requests using Google Apps, Microsoft, Auth0, OKTA, and GitHub login
Stars: ✭ 471 (+435.23%)
Mutual labels:  google, authentication
Hackathon Starter Kit
A Node-Typescript/Express Boilerplate with Authentication(Local, Github, Facebook, Twitter, Google, Dropbox, LinkedIn, Discord, Slack), Authorization, and CRUD functionality + PWA Support!
Stars: ✭ 242 (+175%)
Mutual labels:  google, authentication
Play Authenticate
An authentication plugin for Play Framework 2.x (Java)
Stars: ✭ 813 (+823.86%)
Mutual labels:  google, authentication
Googleauthr
Google API Client Library for R. Easy authentication and help to build Google API R libraries with OAuth2. Shiny compatible.
Stars: ✭ 150 (+70.45%)
Mutual labels:  google, authentication
Turnstile
An authentication framework for Swift.
Stars: ✭ 163 (+85.23%)
Mutual labels:  google, authentication
Keyring
Keyring is an authentication framework for WordPress. It comes with definitions for a variety of HTTP Basic, OAuth1 and OAuth2 web services. Use it as a common foundation for working with other web services from within WordPress code.
Stars: ✭ 52 (-40.91%)
Mutual labels:  google, authentication
Googleclientplugin
Google Client Plugin for Xamarin iOS and Android
Stars: ✭ 69 (-21.59%)
Mutual labels:  google, authentication

gargle

CRAN status Codecov test coverage R-CMD-check

The goal of gargle is to take some of the agonizing pain out of working with Google APIs. This includes functions and classes for handling common credential types and for preparing, executing, and processing HTTP requests.

The target user of gargle is an R package author who is wrapping one of the ~250 Google APIs listed in the APIs Explorer. gargle aims to play roughly the same role as Google’s official client libraries, but for R. gargle may also be useful to useRs making direct calls to Google APIs, who are prepared to navigate the details of low-level API access.

gargle’s functionality falls into two main domains:

  • Auth. The token_fetch() function calls a series of concrete credential-fetching functions to obtain a valid access token (or it quietly dies trying).
    • This covers explicit service accounts, application default credentials, Google Compute Engine, and the standard OAuth2 browser flow.
    • gargle offers the Gargle2.0 class, which extends httr::Token2.0. It is the default class for user OAuth 2.0 credentials. There are two main differences from httr::Token2.0: greater emphasis on the user’s email (e.g. Google identity) and default token caching is at the user level.
  • Requests and responses. A family of functions helps to prepare HTTP requests, (possibly with reference to an API spec derived from a Discovery Document), make requests, and process the response.

See the articles for holistic advice on how to use gargle.

Installation

You can install the released version of gargle from CRAN with:

install.packages("gargle")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("r-lib/gargle")

Basic usage

gargle is a low-level package and does not do anything visibly exciting on its own. But here’s a bit of usage in an interactive scenario where a user confirms they want to use a specific Google identity and loads an OAuth2 token.

library(gargle)

token <- token_fetch()
#> The gargle package is requesting access to your Google account. Select a
#> pre-authorised account or enter '0' to obtain a new token. Press
#> Esc/Ctrl + C to abort.

#> 1: [email protected]
#> 2: [email protected]

#> Selection: 1

token
#> <Token (via gargle)>
#>   <oauth_endpoint> google
#>              <app> gargle-demo
#>            <email> [email protected]
#>           <scopes> ...userinfo.email
#>      <credentials> access_token, expires_in, refresh_token, scope, ...

Here’s an example of using request and response helpers to make a one-off request to the Web Fonts Developer API. We show the most popular web font families served by Google Fonts.

library(gargle)

req <- request_build(
  method = "GET",
  path = "webfonts/v1/webfonts",
  params = list(
    sort = "popularity"
  ),
  key = gargle_api_key(),
  base_url = "https://www.googleapis.com"
)
resp <- request_make(req)
out <- response_process(resp)

out <- out[["items"]][1:8]
vapply(out, function(x) x[["family"]], character(1))
#> [1] "Roboto"           "Open Sans"        "Noto Sans JP"     "Lato"            
#> [5] "Montserrat"       "Source Sans Pro"  "Roboto Condensed" "Oswald"

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

Privacy policy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].