Compare commits
2 commits
6280f848fe
...
6249decb96
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6249decb96 | ||
|
|
e9b2463693 |
2 changed files with 18 additions and 4 deletions
|
|
@ -1 +1,18 @@
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import csv
|
||||||
|
import phonenumbers
|
||||||
|
from pythonvCard4.vcard import Contact
|
||||||
|
|
||||||
|
file = csv.reader(open(sys.argv[1], 'r'))
|
||||||
|
headers = next(file)
|
||||||
|
output = open("vcf/groups.vcf",'w')
|
||||||
|
|
||||||
|
for contact in file:
|
||||||
|
number = phonenumbers.parse(contact[0])
|
||||||
|
number = phonenumbers.format_number(number, phonenumbers.PhoneNumberFormat.INTERNATIONAL)
|
||||||
|
number = [{"value": number, "type": []}]
|
||||||
|
name = contact[1]
|
||||||
|
card = Contact(tel=number, fn=name)
|
||||||
|
vcf_text = card.to_vcard()
|
||||||
|
output.write(vcf_text)
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,9 @@
|
||||||
import os
|
import os
|
||||||
from re import escape
|
|
||||||
import sys
|
import sys
|
||||||
import quopri
|
import quopri
|
||||||
import base64
|
import base64
|
||||||
import pickle
|
|
||||||
import itertools
|
import itertools
|
||||||
import phonenumbers
|
import phonenumbers
|
||||||
import pythonvCard4
|
|
||||||
from pythonvCard4.vcard import Contact
|
from pythonvCard4.vcard import Contact
|
||||||
|
|
||||||
# input should be a valid .vcf file, output in current dir
|
# input should be a valid .vcf file, output in current dir
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue