Let users download profiles as vCards#241
Let users download profiles as vCards#241mrchrisadams merged 2 commits intoGreening-Digital:mainfrom
Conversation
Users can now download a simple [vCard] for profiles they visit. This is implemented as a new route. It uses [VObject], the best Python vCard package I could find. Some work was required to make edge cases work, such as the legacy vCard "name" field. See [issue Greening-Digital#106]. [vCard]: https://en.wikipedia.org/wiki/VCard [VObject]: https://eventable.github.io/vobject/ [issue Greening-Digital#106]: Greening-Digital#106
| return {"text": rendered_invite_txt, "html": rendered_invite_html} | ||
|
|
||
| def vcard(self) -> vobject.vCard: | ||
| properties = { |
There was a problem hiding this comment.
We could add additional properties in the future, but I think this is a good starter set. The vCard Wikipedia page has a good list of these properties, as does the spec.
mrchrisadams
left a comment
There was a problem hiding this comment.
Thanks for this @EvanHahn , this looks great! I'm very happy to merge this in. - I've asked for a couple of docstrings for the tests as a convenience but otherwise I'm very happy for this to be merged in.
I'm not sure you gave the ability to merge in from an approved PR, if not please let me know, and I'll either grant access or merge it in at your end.
| "Biscuit", | ||
| "Dr.", | ||
| "Dr. Gravy Biscuit", | ||
| "Sweet Gravy Biscuit", |
|
I think I've addressed all comments! I don't have permission to merge this myself. Happy to have you do it, or to get the permission to do so myself—whichever is easier for you. |
mrchrisadams
left a comment
There was a problem hiding this comment.
Very happy! Thanks @EvanHahn
Users can now download a simple vCard for profiles they visit. This is implemented as a new route.
Here's how it looks imported into GNOME Contacts:
And into iOS:
It uses VObject, the best Python vCard package I could find. Some work was required to make edge cases work, such as the legacy vCard "name" field.
Addresses #106.