https://github.com/calderonsamuel/appsheet

Functionality to add, delete, read and update table records from your 'AppSheet' apps, using the official API

https://github.com/calderonsamuel/appsheet

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (20.2%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Functionality to add, delete, read and update table records from your 'AppSheet' apps, using the official API

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 1
Created almost 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



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

# appsheet


[![Codecov test coverage](https://codecov.io/gh/calderonsamuel/appsheet/branch/main/graph/badge.svg)](https://app.codecov.io/gh/calderonsamuel/appsheet?branch=main)
[![R-CMD-check](https://github.com/calderonsamuel/appsheet/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/calderonsamuel/appsheet/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/appsheet)](https://CRAN.R-project.org/package=appsheet)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/last-month/appsheet?color=blue)](https://r-pkg.org/pkg/appsheet)


The goal of appsheet is to provide an easy way to use the Appsheet API to retrieve, add, update and delete rows from your app tables. 

The package exports a main function called `appsheet()`, which you can use to perform all the supported actions. A supporting `ash_properties()` function allows you to customize the expected input/output.

Have in mind that there is no evidence that the API will also work well with *slices* and that `appsheet()` returns all the columns as *character* vectors.

## Installation

You can install the stable version of appsheet from CRAN.

```{r, eval=FALSE}
install.packages("appsheet")
```

Also, you can install the development version of appsheet from [GitHub](https://github.com/calderonsamuel/appsheet) with:

``` r
# install.packages("pak")
pak::pak("calderonsamuel/appsheet")
```

## Authentication

The first step is to [Enable the API for cloud-based service communication](https://support.google.com/appsheet/answer/10105769). Once this is done you should have:

1. The App ID. Use it in the `appId` argument of `appsheet()` or via the `APPSHEET_APP_ID` environmental variable.
2. The Application Access Key. Use it in the `access_key` argument of `appsheet()` or via the `APPSHEET_APP_ACCESS_KEY` environmental variable.

The `appsheet()` function looks for both environmental variables by default.

## Example

Here are some examples on how to perform the four basic operations. It all starts with loading the package.

```{r example}
library(appsheet)
```

### Read a table

The first argument of `appsheet()` is a table name. By default, `appsheet()` will use the "Find" action, which reads all the rows. The following code is the equivalent of using `appsheet(tableName = "Driver", Action = "Find")`.

```{r}
appsheet("Driver")
```

When the action is "Find", you can take advantage of the `Selector` argument of `ash_properties()`, which can use some AppSheet internal functions to narrow the output.

```{r}
appsheet(
	tableName = "Driver", 
	Properties = ash_properties(Selector = 'Filter(Driver, [Key] = "70608c66")')
)
```

### Add records to a table 

The "Add" action allows to add one or multiple records to a table. You must provide `Rows`, which can be a dataframe with the same column names as the specified table. You don't need to provide all the columns to be successful, but can't exclude the ones *required* by your app. Also, don't try to add the `_RowNumber`(or `Row ID` when using an AppsSheet database), as it is generated internally.

An "Add" action returns a data.frame with the added rows when successful.

```{r}
row_key <- paste0(sample(letters, 8), collapse = "") # to be reused 

appsheet(
	tableName = "Driver",
	Action = "Add",
	Rows = tibble::tibble(
		Key = row_key, # required in app logic
		`Email` = "driverXX@company.com" # required in app logic
	) 
)
```

### Update records from a table

The "Edit" action allow to update values from one or multiple records from a table, it also can target multiple columns. This one also requires the `Rows` argument. Again, you can't use the `_RowNumber` column (but in this one you can use the `Row ID` generated by an Appsheet database).

An "Edit" action returns a data.frame with the whole content of the updated rows when successful.

```{r}
appsheet(
	tableName = "Driver",
	Action = "Edit",
	Rows = tibble::tibble(
		Key = row_key,
		`Driver Name` = "Some name",
		Photo = "some/path.jpg"
	) 
)
```


### Delete records from a table

The "Delete" action allows to delete one or multiple records from a table. This one also requires the `Rows` argument. Again, you can't use the `_RowNumber` column (but in this one you can use the `Row ID` generated by an Appsheet database).

A "Delete" action returns a data.frame with the deleted rows when successful.

```{r}
appsheet(
	tableName = "Driver",
	Action = "Delete",
	Rows = tibble::tibble(
		Key = row_key
	) 
)
```









Owner

  • Name: Samuel Calderon
  • Login: calderonsamuel
  • Kind: user
  • Location: Lima

Peruvian political scientist

GitHub Events

Total
  • Push event: 2
Last Year
  • Push event: 2

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 50
  • Total Committers: 2
  • Avg Commits per committer: 25.0
  • Development Distribution Score (DDS): 0.02
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Samuel Calderon s****n@u****e 49
olivroy 5****y 1
Committer Domains (Top 20 + Academic)
uarm.pe: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 5
  • Total pull requests: 1
  • Average time to close issues: 27 days
  • Average time to close pull requests: 4 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • calderonsamuel (5)
Pull Request Authors
  • olivroy (2)
Top Labels
Issue Labels
bug (2) enhancement (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 233 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: appsheet

An Interface to the 'AppSheet' API

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 233 Last month
Rankings
Dependent packages count: 28.0%
Forks count: 28.1%
Stargazers count: 34.9%
Dependent repos count: 36.9%
Average: 42.8%
Downloads: 86.1%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/pr-fetch v2 composite
  • r-lib/actions/pr-push v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • cli * imports
  • httr2 * imports
  • magrittr * imports
  • purrr * imports
  • rlang * imports
  • tibble * imports
  • testthat >= 3.0.0 suggests