Compare commits

..

2 commits

Author SHA1 Message Date
diegantobass
6249decb96 import from watsapp 2025-05-08 14:16:28 +02:00
diegantobass
e9b2463693 repair imports 2025-05-08 14:16:15 +02:00
2 changed files with 18 additions and 4 deletions

View file

@ -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)

View file

@ -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