Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datawookie/filebin
https://github.com/datawookie/filebin
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/datawookie/filebin
- Owner: datawookie
- Created: 2021-11-16T05:35:50.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-01T17:16:45.000Z (over 1 year ago)
- Last Synced: 2024-11-12T04:02:55.389Z (2 months ago)
- Language: R
- Size: 169 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
---```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, comment=NA)library(dplyr)
library(tools)suppressWarnings(file.remove("description.txt"))
```# {filebin}
[![CRAN status](https://www.r-pkg.org/badges/version/filebin)](https://cran.r-project.org/package=filebin)
![GitHub Actions build status](https://github.com/datawookie/filebin/actions/workflows/build.yaml/badge.svg)
[![Codecov test coverage](https://img.shields.io/codecov/c/github/datawookie/filebin.svg)](https://app.codecov.io/github/datawookie/filebin)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)Filebin allows you to quickly & easily share files. Development of the software behind Filebin happens here:
- (current) and
- (deprecated).This is an R wrapper for the Filebin API.
The documentation for `{filebin}` can be found [here](https://datawookie.github.io/filebin/).
## Installation
Install the development version from GitHub as follows:
```{r eval = FALSE}
remotes::install_github("datawookie/filebin")
```## Basic Usage
Load the package and check the versions.
```{r}
library(filebin)packageVersion("filebin")
```Upload a file to randomly named bin on Filebin.
```{r eval = FALSE}
DESCRIPTION_PATH <- system.file("DESCRIPTION", package = "filebin")description <- file_post(DESCRIPTION_PATH)
```Take a look at the result.
```{r eval = FALSE}
description %>% select(filename, bin)
```Download a file using an URL.
```{r eval = FALSE}
file_get(description$url, file = "description.txt")
```Download a file using filename and bin.
```{r eval = FALSE}
file_get(
description$filename,
description$bin,
file = "description.txt",
overwrite = TRUE
)
```Compare to original document.
```{r eval = FALSE}
md5sum(c(DESCRIPTION_PATH, "description.txt"))
```## API Endpoints
File endpoints:
- [X] `GET /{bin}/{filename}`
- [X] `DELETE /{bin}/{filename}`
- [X] `POST /{bin}/{filename}`Bin endpoints:
- [X] `GET /{bin}`
- [X] `PUT /{bin}`
- [X] `DELETE /{bin}`
- [X] `GET /qr/{bin}`
- [X] `GET /archive/{bin}/tar`
- [X] `GET /archive/{bin}/zip````{r include=FALSE}
suppressWarnings(file.remove("description.txt"))
```