https://github.com/calderonsamuel/appsheet
Functionality to add, delete, read and update table records from your 'AppSheet' apps, using the official API
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
- Host: GitHub
- Owner: calderonsamuel
- License: other
- Language: R
- Default Branch: main
- Homepage: https://calderonsamuel.github.io/appsheet/
- Size: 113 KB
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
[](https://app.codecov.io/gh/calderonsamuel/appsheet?branch=main)
[](https://github.com/calderonsamuel/appsheet/actions/workflows/R-CMD-check.yaml)
[](https://CRAN.R-project.org/package=appsheet)
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
[](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
- Website: www.samuelenrique.com
- Twitter: samucalse
- Repositories: 9
- Profile: https://github.com/calderonsamuel
Peruvian political scientist
GitHub Events
Total
- Push event: 2
Last Year
- Push event: 2
Committers
Last synced: 12 months ago
Top Committers
| Name | 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
- Homepage: https://github.com/calderonsamuel/appsheet
- Documentation: http://cran.r-project.org/web/packages/appsheet/appsheet.pdf
- License: MIT + file LICENSE
-
Latest release: 0.1.0
published almost 3 years ago
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