Tools to split and merge vCard files.
Project description
# vcardtools
Command line tools for splitting and merging vCard files.
There are a lot of tutorials for setting up contact servers and syncing -- but few cover the most basic step we need to take.
_Getting our vCards into a sensible shape where we can use them._
Thus far there are two operations available in vcardtools:
- splitting giant .vcf files into lots of little ones with nice names
- **and**
- merging little .vcf files two at a time with interactive prompting
##Installation
`pip install vcardtools`
##vcardtool split --help
```bash
vcardtool merge -h
usage: vcardtool merge [-h] [--outfile [OUTFILE]] vcard_files vcard_files
positional arguments:
vcard_files Two vCard files to merge
optional arguments:
-h, --help show this help message and exit
--outfile [OUTFILE] Write merged vCard to file
vcardtool merge john-1.vcf john-2.vcf
```
##vCard Merge Sample Usage
`$ vcardtool merge john-1.vcf john-2.vcf`
<output editted for brevity>
In the even of a conflict you'll see something like:
```
Please select one of the following options for field "label"
[ 1 ] "[<LABEL{'TYPE': ['WORK']}100 Waters Edge Baytown, LA 30314 United States of America>,
<LABEL{'TYPE': ['HOME']}42 Plantation St. Baytown, LA 30314 United States of America>]"
[ 2 ] "[<LABEL{'TYPE': ['HOME']}42 Plantation St. Baytown, LA 30314 United States of America>]"
option> 5
option> 1
```
And then hopefully victory.
```
BEGIN:VCARD
VERSION:3.0
ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
FN:Forrest Gump
LABEL;TYPE=WORK:100 Waters Edge\nBaytown\, LA 30314\nUnited States of Ameri
ca
LABEL;TYPE=HOME:42 Plantation St.\nBaytown\, LA 30314\nUnited States of Ame
rica
N:Gump;Forrest;;Mr.;
PHOTO;TYPE=JPEG;VALUE=URL:http://www.example.com/dir_photos/my_photo.gif
REV:2008-04-24T19:52:43Z
TEL;TYPE=HOME,VOICE:(111) 555-5555
TEL;TYPE=WORK,VOICE:(111) 555-1212
TEL;TYPE=HOME,VOICE:(404) 555-1212
TITLE:Shrimp Man
END:VCARD
```
By default the merge command writes to stdout although it can be directed to a file with `--outfile shiny_new.vcf`.
Command line tools for splitting and merging vCard files.
There are a lot of tutorials for setting up contact servers and syncing -- but few cover the most basic step we need to take.
_Getting our vCards into a sensible shape where we can use them._
Thus far there are two operations available in vcardtools:
- splitting giant .vcf files into lots of little ones with nice names
- **and**
- merging little .vcf files two at a time with interactive prompting
##Installation
`pip install vcardtools`
##vcardtool split --help
```bash
usage: vcardtool merge [-h] [--outfile [OUTFILE]] vcard_files vcard_files
positional arguments:
vcard_files Two vCard files to merge
optional arguments:
-h, --help show this help message and exit
--outfile [OUTFILE] Write merged vCard to file
vcardtool merge john-1.vcf john-2.vcf
```
##vCard Merge Sample Usage
`$ vcardtool merge john-1.vcf john-2.vcf`
<output editted for brevity>
In the even of a conflict you'll see something like:
```
Please select one of the following options for field "label"
[ 1 ] "[<LABEL{'TYPE': ['WORK']}100 Waters Edge Baytown, LA 30314 United States of America>,
<LABEL{'TYPE': ['HOME']}42 Plantation St. Baytown, LA 30314 United States of America>]"
[ 2 ] "[<LABEL{'TYPE': ['HOME']}42 Plantation St. Baytown, LA 30314 United States of America>]"
option> 5
option> 1
```
And then hopefully victory.
```
BEGIN:VCARD
VERSION:3.0
ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
FN:Forrest Gump
LABEL;TYPE=WORK:100 Waters Edge\nBaytown\, LA 30314\nUnited States of Ameri
ca
LABEL;TYPE=HOME:42 Plantation St.\nBaytown\, LA 30314\nUnited States of Ame
rica
N:Gump;Forrest;;Mr.;
PHOTO;TYPE=JPEG;VALUE=URL:http://www.example.com/dir_photos/my_photo.gif
REV:2008-04-24T19:52:43Z
TEL;TYPE=HOME,VOICE:(111) 555-5555
TEL;TYPE=WORK,VOICE:(111) 555-1212
TEL;TYPE=HOME,VOICE:(404) 555-1212
TITLE:Shrimp Man
END:VCARD
```
By default the merge command writes to stdout although it can be directed to a file with `--outfile shiny_new.vcf`.