Questions tagged [vobject]

vObject is intended to be a full featured Python package for parsing and generating vCard and vCalendar files.

29 questions
1
vote
1 answer

Reference object created in middle of function with unittest mock

If I have a function like this: def get_vcard(): new_vcard = vobject.vCard() new_vcard.add('fn') new_card.fn.value = 'First Last' work_phone = new_vcard.add('tel') work_phone.value = '+18005555555' mobile_phone =…
Tamerz
  • 897
  • 1
  • 10
  • 25
1
vote
1 answer

Creating and sending vCard files via MMS

I'm trying to send vCard files (which allow you to save contacts on mobile devices) using Twilio's API and vobject. Here's my code: import vobject import requests from twilio.rest import Client account_sid = 'MY_SID_HIDDEN' auth_token =…
rustyshackleford
  • 692
  • 1
  • 7
  • 22
1
vote
3 answers

Get all values for an attribute in a vcard using python vobject

If I import a vcard with vobject like this: with open(some_file_containing_a_vcard, "r" , encoding="utf-8") as fd: vcard_content = vobject.readOne(fd.read(), …
Christian Rößner
  • 447
  • 1
  • 5
  • 18
1
vote
1 answer

Won't read multiple vcards from .vcf file, vobject.readOne(f) only works the first vcard

#!/usr/bin/env python2.7 import vobject abfile='/foo/bar/directory/file.vcf' def test_vobject_dot_readOne(): with open(abfile) as f: vcard = vobject.readOne(f) vcard = vobject.readOne(f) …
1
vote
1 answer

how to parse vcard with multiple contacts

I am trying to import contacts through vcard I have successfully parsed it to get: BEGIN:VCARD VERSION:3.0 FN:Harsimer Kaur N:Kaur;Harsimer;;; X-EVOLUTION-FILE-AS:Kaur\,…
Always_a_learner
  • 4,585
  • 13
  • 63
  • 112
1
vote
1 answer

Parsing vcf file in django-python using vobject

I am using vobject module to parse a vcard which I have exported from MS outlook. It has content as below: BEGIN:VCARD VERSION:2.1 N:Salei;Roya FN:Roya Salei ORG:MealPlanBook TEL;WORK;VOICE:(3)…
Always_a_learner
  • 4,585
  • 13
  • 63
  • 112
1
vote
0 answers

Vobject- Entering Fax number into Vcard

I'm writing a simple script that uses an excel spreadsheet as a source to produce a number of Vcards (our internal company telephone list). I can successfully interrogate the spreadsheet, using the xlrd module to gain phone numbers, email addresses…
Robert
  • 21
  • 3
0
votes
0 answers

vObject (carddav) - how to set multiple parameters for telephone

I'm trying to build a vcard using vobject python library. The server uses multiple phone types like this: TEL;TYPE="HOME","VOICE":111111111 TEL;TYPE="WORK","VOICE":4444444444 So I'm trying to do the same. vcard_phone =…
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
1 answer

Python importing Vcard Photo

I'm trying to import a photo into my card using vobject. I have the image stored inside my static folder and the filename inside my database. I would like to import it in my VCard. So far I have made this: if request.method == "POST": …
user13206197
0
votes
1 answer

How to get freebusy details in python-caldav library

I am using python-caldav and vobject Python libraries to connect to and parse calendar files from a private caldav server. I cannot for the life of me figure out how to make a freebusy request using these libraries. I've searched through the…
0
votes
0 answers

error when serializing calendar event

I am trying to modify calendars using the python caldav library (version 0.5.0) on python 2.7. I am using the following code snippet to add an exdate to recurring events for event in results: vevent = event.instance.vevent if…
Michael
  • 3,510
  • 1
  • 11
  • 23
0
votes
0 answers

How to manipulate VCF contacts using VObject?

suppose i have built a VObject called vobj (e.g., built via vobject.readComponents(vcfStr)) and want to add a new key:value pair to it: print('k=%s v=%s' % (k,v)) try: stmnt1 = "vobj.add('%s')" % (k) print('stmnt1:"%s"' % stmnt1) …
rikb
  • 630
  • 5
  • 18
0
votes
2 answers

To remove vcard contact duplicates, comparing if two vcards are equal in .vcf file does not work with simple == vobject comparison

#!/usr/bin/env python2.7 import vobject abfile='/foo/bar/directory/file.vcf' #ab stands for address book ablist = [] with open(abfile) as source_file: for vcard in vobject.readComponents(source_file): …
0
votes
2 answers

how to check with vobject either string is valid vcard or not when dealing with UTF-8 characters?

how to check with vobject either string is valid vcard or not? Is there some extra method or generall approach with try and catch? For now I do it as follows: try: vobj = vobject.readOne(vcard_readable) except Exception as e: …
andilabs
  • 22,159
  • 14
  • 114
  • 151
1
2