Skip to content

Conversation

@SSPJ
Copy link

@SSPJ SSPJ commented Apr 7, 2025

I would like a few of the vcard 4.0 features for a small side project I'm working on.

This is not comprehensive, but I've done my best to make sure it is fully backwards compatible. All feedback welcome.

What this PR includes

  • Support for ALTID such that properties like N with a cardinality of *1 do not fail validation when the additional content lines use a matching ALTID.
  • Parsing of CLIENTPIDMAP
  • Parsing of GENDER
  • Partial support for comma-delinated parameter values, so that TYPE="video,cell" will become {"TYPE": ['video', 'cell']}

What this PR does not include

  • Any support for KIND other than individual.
  • Round-trip support for comma-delinated parameter values. Serialization still uses vcard 3.0 style, so the above example would become TYPE=video;TYPE=cell. This likely doesn't matter for most parameters, but might cause issues with PID.
  • Nice-to-haves for CLIENTPIDMAP. This property opens the door to a lot of useful features, like "validate this card's PID map", "given this card's email address, tell me if that card contains a matching property", or even "merge these two cards for me". I did not go down this rabbit-hole.

htgoebel and others added 30 commits November 29, 2021 23:16
Copy content from README.
Add some further explanations and structure.
Merged content from Jeffrey's Skyhouse Consulting site.
Merged Sameen's content from GitHub.
Rewrote a bunch of the model discussion too.
Move example file content into code as well, for easier control.
Fix timezone names in test suite
Removed reference to setup.py, since it's no longer used in v1.0
Add first draft of programmer's guide doc
Improve log message for unknown timezone
This was based on a review of PR py-vobject#52 from @lucc, reviewed by @dbarnett, that
I didn't end up using as I set up the v1.0 build.  With this change, I've
pulled in the things in @lucc's PR that weren't there already.
Add some missing info to the project file.
"repository" ends up being just an alias for "source", plus it had a typo.
Add "documentation" link to readthedocs.
Add some missing stuff to the sdist.
rsb-23 and others added 29 commits January 6, 2025 23:57
- inlined strings
- Added py313 in black
Adding pre-commit with linters and formatters
- configured to baseline project errors
- using line-length 130, a 10 threshold with black tool
- see pylintrc file diff
fixed errors with < 4 count
- removed print function
- inlined docstring to reduce lines
- disbaled pylint in test compatibility
- made f-string conversions
- minor linting fixes
- Added tests
The exceptions are calls to logging.* functions, where parameters
should be passed in *args, so that substitution isn't performed unless
the message needs to be emitted; and, a series of uses in constructing
parsing regexps, where the named lookup is arguably clearer.
These looked a bit messy to start with, but the reality was not so
bad.  I think the resulting code is substantially more clear too.
Caught by unit tests.
PDF files should not have their content messed with by Git's EOL stuff
so make sure they're treated as binary.
Add original Versit specifications for vCard 2.1 and vCalendar 1.0.
Ubuntu 24.10 (at least) has removed the "US/*" time zone names from the
installed zoneinfo database: the files are now available through a
supplementary package, "tzdata-legacy", but it is not installed by
default.

To avoid confusing, pointless, breakage, switch to using the
"America/New_York" name, which is (thus far) universally available,
but semantically identical.
…alendarpytest_omits_dst_offset-fails

Change unit test to use "America/New_York" time zone name.
These tests migrated to use in-file data some time ago.
Add support for KIND (limited to individual), CLIENTPIDMAP, GENDER,
comma-delinated paramater values, and ALTID.
@SSPJ SSPJ mentioned this pull request Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants