Giter Site home page Giter Site logo

usegs's Introduction

Build Status codecov.io

usegs

usegs package allows easy copy of Goolge Sheets to local project files. Acceptance files or other data where Google Sheet is source can be easiliy copied.

Installation

You can install usegs from github with:

# install.packages("devtools")
devtools::install_github("byapparov/usegs")

Example

This is a basic example which shows you how to save acceptance data into testthat data folder:

## This code ran in the working directory of package 
## will create files in `tests/testthat/data/{sheet-name}/` folder
use_gs_acceptance(
  x = "1bkoQYLYAVqgP4bCoqVe-yDB1mdX83cFtOqJ7q8GkT-w",
  extension = "csv"
)

You can also refresh data for all of your acceptance tests if you maintain .acceptance.yml file.

This file contains a simple structure that references Google Sheets and instructs how to save them locally:

# .acceptance.yml file in working directory of the project or package
acceptance_documents:
  - key: '1bkoQYLYAVqgP4bCoqVe-yDB1mdX83cFtOqJ7q8GkT-w' # Google Sheet key
    extension: csv # defines how data will be saved localy
    description: Accceptance file example 1 # you can add other fields for documentation purposes
    story: ST-100
    folder: order/tests

  - key: '2bkoQYLYAVqgP4bCoqVe-yDB1mdX83cFtOqJ7q8GkT-x'
    extension: json
    description: Accceptance file example 2
    story: ST-200
# Running this function will save data from all acceptance 
# Google Sheet files localy in 'tests/testthat/data/{doc title}/' folders
usegs::refresh_project_acceptance()

usegs's People

Contributors

byapparov avatar karimzaoui avatar

Watchers

James Cloos avatar  avatar

usegs's Issues

Way to document data catalogue in code

library(httr)
url.base <- "https://raw.githubusercontent.com/{organisation}/{repository}/master/"
schema.path <- "purchase-order/schema/purchase-order.json"
url <- paste0(url.base, schema.path)
x <- GET(url, authenticate(Sys.getenv("GITHUB_PAT"), ""))
response <- content(x, as="text", type = "text", encoding = "UTF-8")
schema.table <- fromJSON(response)
# .catalogue

- purchase-order
  - file: schema/purchase-order.json
- sale-order-line
  - file: ...

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.