vCard 4.0 implementation#196
Closed
jwiegley wants to merge 1 commit into
Closed
Conversation
New Files:
- vobject/vcard40.py - Complete vCard 4.0 (RFC 6350) implementation
- test_files/vcard40_simple.vcf - Basic vCard 4.0 test file
- test_files/vcard40_full.vcf - Full vCard 4.0 with all properties
- test_files/vcard40_group.vcf - vCard 4.0 with KIND=group and MEMBER
- test_files/vcard40_org.vcf - vCard 4.0 for organization
- test_files/vcard40_location.vcf - vCard 4.0 for location
- test_files/vcard40_multilang.vcf - Multilingual vCard 4.0 with ALTID
Modified Files:
- vobject/__init__.py - Added version parameter to vCard(version='3.0')
- tests.py - Updated behavior registry test for new behaviors
- test_files/more_tests.txt - Added dual-version doctest tests
New vCard 4.0 Properties Implemented
- KIND - individual/group/org/location
- GENDER - sex and gender identity
- ANNIVERSARY - marriage date
- LANG - language preferences with PREF
- IMPP - instant messaging URIs
- RELATED - relationships with TYPE
- MEMBER - group members (only for KIND=group)
- CLIENTPIDMAP - sync mapping
- XML - extended XML data
- SOURCE - vCard source URI
Usage:
```python
import vobject
v3 = vobject.vCard()
v4 = vobject.vCard('4.0')
v4.add('fn').value = 'John Doe'
v4.add('kind').value = 'individual'
v4.add('gender').value = 'M'
parsed = vobject.readOne(vcard_string) # Works for both 3.0 and 4.0
```
Author
|
With this support, I intend to upgrade Radicale to use vCard 4.0, so that will give me a good ground for real-life testing. See: Kozea/Radicale#1948. I'm now running this version on my home lab server. |
Collaborator
|
Sounds great -- I'll have a look at merging this into py-vobject/vobject |
Contributor
|
Just note that the implementation in Radicale relies on vobject version to offer vCard 4.0 support and assumes this for version >= 1.0.0 |
Collaborator
|
@jwiegley -- could you create a new pull request against py-vobject/vobject? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Files:
Modified Files:
New vCard 4.0 Properties Implemented
Usage: