Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/i2z1/vcardr

Read/write VCF contact files with R
https://github.com/i2z1/vcardr

contacts r vcard vcf

Last synced: about 4 hours ago
JSON representation

Read/write VCF contact files with R

Awesome Lists containing this project

README

        

---
output: github_document
---

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

```{r generate_hex, include=FALSE, fig.path="man/figures/hex-"}
library(hexSticker)

imgurl <- "man/figures/phone_small.png"

hexSticker::sticker(imgurl, package="vcardr",
p_size=28,
p_y=1.5,
s_x=0.96,
s_y=0.8,
s_width=0.6,
s_height=0.5,
h_fill = "#055a43",
p_color = "#dcc535",
h_color = "#34897c", #border
p_family = "teko",
filename="man/figures/hex.png")
```

# vcardr

# vcardr

Read/write VCF contact files in vCard format with R

## Description

Imports data from vcf vcard format into R dataframe, basic manipulations with contacts data and write back into vsf vcard file format, which can be imported with various contact apps.

Also can import data from Telegram JSON (data export procedure).

Supports VCARD 3.0 file format, including these fields:

- FN -- full name
- N -- name fields
- BDAY
- PHOTO (in base64 format)
- TEL -- including phone type (HOME/CELL/FAX...) and preferable phone
- ORG
- TITLE

## Installation

You can install the development version of vcardr from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("i2z1/vcardr")
```

## Example

#### Make dataframe from VCF file:

```{r example, eval = FALSE}
library(vcardr)

df <- vcardr::import_vcf("path_to_file.vcf")
## basic example code
```

Note that if contact has few phone numbers, record would consist of coressponding number of rows in dataframe with the same set of columns but various telephone numbers.

#### Import Telegram JSON:

```{r example2, eval = FALSE}
df <- vcardr::import_telegramJSON("data.json")
```

#### Write vCard

```{r example3, eval = FALSE}
export2vcf(contacts_df, "mycontacts.vcf")
```