You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.4 KiB

8 years ago
---
5 years ago
output:
rmarkdown::github_document:
df_print: kable
8 years ago
---
5 years ago
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/0.1.0/active.svg)](https://www.repostatus.org/#active)
[![Travis-CIBuild Status](https://travis-ci.org/hrbrmstr/simplemagic.svg?branch=master)](https://travis-ci.org/hrbrmstr/simplemagic)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/hrbrmstr/simplemagic?branch=master&svg=true)](https://ci.appveyor.com/project/hrbrmstr/simplemagic)
[![Coverage Status](https://img.shields.io/codecov/c/github/hrbrmstr/simplemagic/master.svg)](https://codecov.io/github/hrbrmstr/simplemagic?branch=master)
8 years ago
# wand
Lightweight File 'MIME' Type Detection Based On Contents or Extension
8 years ago
## Description
8 years ago
'MIME' types are shorthand descriptors for file contents and can be
determined from "magic" bytes in file headers, file contents or intuited from
file extensions. Tools are provided to perform curated "magic" tests as well
as mapping 'MIME' types from a database of over 1,500 extension mappings.
8 years ago
## SOME IMPORTANT DETAILS
8 years ago
The header checking is minimal (i.e. nowhere near as comprehensive as `libmagic`) but covers quite a bit of ground. If there are content-check types from [`magic sources`](https://github.com/threatstack/libmagic/tree/master/magic/) that you would like coded into the package, please file an issue and _include the full line(s)_ from that linked `magic.tab` that you would like mapped.
8 years ago
## What's Inside The Tin
8 years ago
5 years ago
```{r ingredients, results='asis', echo=FALSE}
hrbrpkghelpr::describe_ingredients()
```
The following functions are implemented:
8 years ago
## Installation
8 years ago
5 years ago
```{r install-ex, results='asis', echo = FALSE}
hrbrpkghelpr::install_block()
8 years ago
```
```{r message=FALSE, warning=FALSE, error=FALSE, include=FALSE}
8 years ago
options(width=120)
```
## Usage
8 years ago
```{r message=FALSE, warning=FALSE, error=FALSE}
8 years ago
library(wand)
library(tidyverse)
8 years ago
8 years ago
# current verison
8 years ago
packageVersion("wand")
8 years ago
```
```{r}
list.files(system.file("extdat", package="wand"), full.names=TRUE) %>%
map_df(~{
5 years ago
tibble(
fil = basename(.x),
mime = list(get_content_type(.x))
)
}) %>%
5 years ago
unnest()
```
## Package Code Metrics
```{r}
cloc::cloc_pkg_md()
```
8 years ago
## Code of Conduct
8 years ago
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.
8 years ago