Skip to content

i2z1/vcardr

Repository files navigation

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 with:

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

Example

Make dataframe from VCF file:

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:

df <- vcardr::import_telegramJSON("data.json")

Write vCard

export2vcf(contacts_df, "mycontacts.vcf")